:root {
  --bg-dark: #140b07;
  --bg-card: #1f110b;
  --bg-elevated: #2a170f;
  --bg-input: #120906;
  --text-main: #fffaf5;
  --text-muted: #d6c3b6;
  --text-soft: #a89182;
  --brand-yellow: #ffc72c;
  --brand-yellow-soft: rgba(255, 199, 44, 0.14);
  --brand-orange: #f57c00;
  --brand-red: #d91b1b;
  --brand-red-dark: #9e1111;
  --brand-red-soft: rgba(217, 27, 27, 0.16);
  --brand-green: #2e7d32;
  --brand-green-bright: #4caf50;
  --brand-green-soft: rgba(76, 175, 80, 0.16);
  --border-subtle: rgba(255, 199, 44, 0.16);
  --border-strong: rgba(255, 199, 44, 0.35);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65);
  --font-display: 'Fredoka', 'Bebas Neue', sans-serif;
  --font-condensed: 'Bebas Neue', sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

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

img {
  max-width: 100%;
  display: block;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(255, 199, 44, 0.12);
  color: var(--brand-yellow);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.88em;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-yellow { color: var(--brand-yellow); }
.text-green { color: #66bb6a; }
.text-red { color: #ff6b6b; }

/* ==========================================================================
   BUTTONS & INPUTS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-sm {
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 10px;
}

.btn-lg {
  font-size: 1.02rem;
  padding: 14px 24px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-yellow) 0%, var(--brand-orange) 100%);
  color: #1a0c06;
  box-shadow: 0 8px 20px rgba(245, 124, 0, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(255, 199, 44, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-outline {
  background: rgba(255, 199, 44, 0.08);
  color: var(--brand-yellow);
  border-color: rgba(255, 199, 44, 0.35);
}

.btn-outline:hover {
  background: rgba(255, 199, 44, 0.18);
  border-color: var(--brand-yellow);
}

.btn-danger-outline {
  background: rgba(217, 27, 27, 0.12);
  color: #ff8a80;
  border-color: rgba(217, 27, 27, 0.4);
}

.btn-danger-outline:hover {
  background: var(--brand-red);
  color: #fff;
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: radial-gradient(circle at top right, #2e1409 0%, var(--bg-dark) 65%);
  overflow: hidden;
}

.login-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.25;
  pointer-events: none;
}

.login-glow-yellow {
  background: var(--brand-yellow);
  top: -120px;
  left: -100px;
}

.login-glow-red {
  background: var(--brand-red);
  bottom: -120px;
  right: -100px;
}

.login-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 470px;
}

.login-card {
  background: linear-gradient(180deg, #25140d 0%, #190d08 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  text-align: center;
  margin-bottom: 18px;
}

.login-brand-badge {
  display: inline-block;
  background: rgba(255, 199, 44, 0.14);
  color: var(--brand-yellow);
  border: 1px solid rgba(255, 199, 44, 0.35);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.login-brand-title {
  font-family: var(--font-display);
  font-size: 2.1rem;
  color: var(--brand-yellow);
  text-shadow: 0 3px 0 #7a1010;
  line-height: 1.1;
}

.login-brand-title small {
  font-size: 1.2rem;
  color: var(--text-main);
}

.login-brand-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.login-Showcase {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 125px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-showcase-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  filter: brightness(0.75);
}

.login-showcase-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 11, 7, 0.15) 0%, rgba(20, 11, 7, 0.9) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 700;
}

.showcase-tag {
  color: var(--brand-yellow);
}

.showcase-hours {
  color: var(--text-main);
  font-size: 0.75rem;
  opacity: 0.9;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid rgba(255, 199, 44, 0.25);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.18);
}

.input-icon,
.input-prefix {
  padding-left: 13px;
  color: var(--brand-yellow);
  font-weight: 700;
  font-size: 0.95rem;
  user-select: none;
}

.unit-suffix {
  padding-right: 13px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
}

.input-wrapper input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.96rem;
  padding: 12px;
  outline: none;
}

.btn-icon-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 12px;
  font-size: 1rem;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.remember-me input[type="checkbox"] {
  accent-color: var(--brand-yellow);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.login-error {
  background: rgba(217, 27, 27, 0.2);
  border: 1px solid var(--brand-red);
  color: #ffcdd2;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  animation: loginShake 0.35s ease;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

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

.admin-app:not([hidden]) {
  animation: fadeInPanel 0.28s ease-out;
}

.btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none !important;
}

.login-footer-links {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.login-footer-links a:hover {
  color: var(--brand-yellow);
}

/* ==========================================================================
   TOPBAR & HEADER (ADMIN PANEL)
   ========================================================================== */
.topbar {
  background: linear-gradient(90deg, #241008 0%, #361509 50%, #241008 100%);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  padding: 8px 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.status-badge,
.api-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot,
.api-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-yellow);
  box-shadow: 0 0 8px var(--brand-yellow);
}

.status-badge.is-open .status-dot,
.api-badge.is-online .api-dot {
  background-color: #4caf50;
  box-shadow: 0 0 8px #4caf50;
}

.topbar-link:hover {
  color: var(--brand-yellow);
}

.divider {
  opacity: 0.35;
}

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 11, 7, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-icon {
  font-size: 2rem;
  background: rgba(255, 199, 44, 0.14);
  border: 1px solid rgba(255, 199, 44, 0.35);
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--brand-yellow);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-pill {
  background: var(--brand-red);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.06em;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 199, 44, 0.14);
  color: var(--brand-yellow);
}

.user-session {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.user-role {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--brand-yellow);
  letter-spacing: 0.05em;
}

.user-email {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   MAIN CONTENT & DASHBOARD BANNER
   ========================================================================== */
.main-content {
  padding: 28px 0 60px;
}

.dashboard-banner {
  background: linear-gradient(135deg, #2b140b 0%, #1c0e08 60%, #2e110b 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.banner-text {
  max-width: 760px;
}

.slogan-pill {
  display: inline-block;
  background: rgba(255, 199, 44, 0.15);
  color: var(--brand-yellow);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.dashboard-banner h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.dashboard-banner p {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   KPI CARDS
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-md);
}

.kpi-highlight {
  background: linear-gradient(180deg, #29160d 0%, #1f110b 100%);
  border-color: rgba(255, 199, 44, 0.4);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon {
  font-size: 1.35rem;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
}

.kpi-subbadge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.badge-green {
  background: var(--brand-green-soft);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.35);
}

.badge-red {
  background: var(--brand-red-soft);
  color: #ff8a80;
  border: 1px solid rgba(217, 27, 27, 0.4);
}

.badge-yellow {
  background: var(--brand-yellow-soft);
  color: var(--brand-yellow);
  border: 1px solid rgba(255, 199, 44, 0.35);
}

.kpi-foot {
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* ==========================================================================
   SECTIONS & SEARCH PANEL
   ========================================================================== */
.section-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}

.section-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand-yellow);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-main);
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
  max-width: 820px;
}

.view-mode-toggle {
  display: inline-flex;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn.active {
  background: var(--brand-yellow);
  color: #1a0c06;
}

.search-panel {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 199, 44, 0.22);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

.search-input-Row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.search-box {
  flex: 1 1 380px;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 2px solid rgba(255, 199, 44, 0.35);
  border-radius: 12px;
  transition: all 0.2s;
}

.search-box:focus-within {
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 4px rgba(255, 199, 44, 0.16);
}

.search-icon {
  padding-left: 14px;
  font-size: 1.1rem;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 13px 12px;
  outline: none;
}

.clear-search-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-right: 10px;
  cursor: pointer;
  font-size: 0.8rem;
}

.filter-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.select-control {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid rgba(255, 199, 44, 0.28);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.select-control:focus {
  border-color: var(--brand-yellow);
}

.select-lg {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.96rem;
}

.quick-chips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-chips-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-soft);
  margin-right: 4px;
}

.chip-filter {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
}

.chip-filter:hover,
.chip-filter.active {
  background: var(--brand-yellow);
  color: #1a0c06;
  border-color: var(--brand-yellow);
  font-weight: 700;
}

.results-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ==========================================================================
   PRICING TABLE
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  background: #180d08;
  font-size: 0.9rem;
}

.pricing-table thead th {
  background: #28150d;
  color: var(--brand-yellow);
  font-weight: 700;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.pricing-table thead th small {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.74rem;
}

.pricing-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s;
}

.pricing-table tbody tr:hover {
  background: rgba(255, 199, 44, 0.05);
}

.pricing-table tbody tr.row-cheaper {
  background: rgba(46, 125, 50, 0.12);
}

.pricing-table tbody tr.row-expensive {
  background: rgba(217, 27, 27, 0.12);
}

.pricing-table td {
  padding: 13px 12px;
  vertical-align: middle;
}

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

.product-emoji {
  font-size: 1.35rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 199, 44, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-name {
  font-weight: 700;
  color: var(--text-main);
  display: block;
}

.product-category {
  font-size: 0.74rem;
  color: var(--text-soft);
}

.price-base-highlight {
  font-weight: 800;
  color: var(--text-main);
  font-size: 0.98rem;
}

.unit-cost-highlight {
  font-weight: 800;
  color: var(--brand-yellow);
  font-size: 0.96rem;
}

.prop-reference {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.th-simulator {
  background: rgba(255, 199, 44, 0.12) !important;
  min-width: 205px;
}

.sim-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sim-price-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid rgba(255, 199, 44, 0.35);
  border-radius: 9px;
  padding: 0 8px;
  width: 125px;
}

.sim-price-wrapper span {
  font-size: 0.78rem;
  color: var(--brand-yellow);
  font-weight: 700;
}

.sim-price-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 7px 6px;
  outline: none;
}

.btn-clear-row {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.78rem;
}

.btn-clear-row:hover {
  background: var(--brand-red);
  color: #fff;
}

.diff-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.diff-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
}

.diff-cheaper {
  background: var(--brand-green-soft);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.4);
}

.diff-expensive {
  background: var(--brand-red-soft);
  color: #ff8a80;
  border: 1px solid rgba(217, 27, 27, 0.4);
}

.diff-same {
  background: var(--brand-yellow-soft);
  color: var(--brand-yellow);
}

.table-totals-row td {
  background: #26140c;
  border-top: 2px solid var(--border-strong);
  padding: 16px 12px;
}

/* ==========================================================================
   MOBILE CARDS VIEW (SUPERMARKET MODE)
   ========================================================================== */
.pricing-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 16px;
}

.product-buy-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.product-buy-card.card-cheaper {
  border-color: #4caf50;
}

.product-buy-card.card-expensive {
  border-color: var(--brand-red);
}

.buy-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.buy-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(0, 0, 0, 0.28);
  padding: 12px;
  border-radius: 12px;
}

.buy-metric-box small {
  display: block;
  font-size: 0.73rem;
  color: var(--text-soft);
}

.buy-metric-box strong {
  font-size: 1.02rem;
  color: var(--text-main);
}

.buy-card-sim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.buy-card-sim-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ==========================================================================
   COMPARATOR SECTION
   ========================================================================== */
.comparator-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 22px;
}

.comparator-form-card,
.comparator-result-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
}

.calc-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

.field-help {
  font-size: 0.76rem;
  color: var(--text-soft);
}

.calc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.result-product-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--brand-yellow);
}

.result-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.result-col {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.result-col-highlight {
  border-color: rgba(255, 199, 44, 0.35);
  background: rgba(255, 199, 44, 0.05);
}

.result-col-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-col-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.result-col-sub {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.result-col-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 0;
}

.result-col-metric {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.result-verdict {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--text-main);
  font-weight: 600;
}

/* ==========================================================================
   MENU & MARGIN CARDS + FLYERS
   ========================================================================== */
.menu-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.menu-admin-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-admin-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

.menu-admin-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.menu-admin-top h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.menu-ingredients {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.menu-sell-price {
  text-align: right;
  flex-shrink: 0;
}

.menu-sell-price small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-soft);
}

.menu-sell-price strong {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand-yellow);
}

.menu-metrics-list {
  margin-top: auto;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.flyers-showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.flyer-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.flyer-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: top center;
}

.flyer-caption {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.flyer-caption strong {
  font-size: 0.92rem;
  color: var(--brand-yellow);
}

.flyer-caption span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ECOSYSTEM & CORS SECTION
   ========================================================================== */
.ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.eco-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eco-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.eco-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand-yellow);
  letter-spacing: 0.05em;
}

.eco-status {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.eco-status.status-ok {
  background: var(--brand-green-soft);
  color: #81c784;
}

.eco-url {
  display: block;
  padding: 8px 10px;
  word-break: break-all;
}

.eco-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.eco-meta,
.eco-link {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-yellow);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  background: #100805;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (TABLET & CELULAR)
   ========================================================================== */

/* Tablet Landscape & Portrait (<= 1080px) */
@media (max-width: 1080px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .menu-admin-grid,
  .ecosystem-grid,
  .flyers-showcase {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .header-inner {
    gap: 12px;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .nav-link {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .search-box {
    flex: 1 1 100%;
    min-width: 0;
  }

  .filter-controls {
    width: 100%;
  }

  .filter-controls .select-control {
    flex: 1 1 calc(50% - 6px);
    min-width: 180px;
  }
}

/* Tablet Portrait (<= 860px) */
@media (max-width: 860px) {
  .topbar-inner {
    justify-content: center;
    text-align: center;
  }

  .topbar-left,
  .topbar-right {
    justify-content: center;
  }

  .dashboard-banner {
    padding: 20px;
    gap: 16px;
  }

  .dashboard-banner h2 {
    font-size: 1.5rem;
  }

  .section-block {
    padding: 22px 18px;
  }
}

/* Celular / Mobile (<= 680px) */
@media (max-width: 680px) {
  .container {
    padding: 0 14px;
  }

  .topbar {
    font-size: 0.76rem;
    padding: 6px 0;
  }

  .topbar-right .divider {
    display: none;
  }

  .topbar-right {
    gap: 8px 14px;
  }

  .header {
    padding: 10px 0;
  }

  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .brand {
    gap: 9px;
    min-width: 0;
    flex: 1;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 1.15rem;
    flex-wrap: wrap;
    gap: 6px;
  }

  .brand-subtitle {
    display: none;
  }

  .user-session {
    width: auto;
    gap: 8px;
    flex-shrink: 0;
  }

  .user-email {
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 8px;
    margin-top: 2px;
  }

  .main-content {
    padding: 18px 0 44px;
  }

  .dashboard-banner {
    padding: 18px 16px;
    border-radius: var(--radius-md);
  }

  .dashboard-banner h2 {
    font-size: 1.35rem;
  }

  .dashboard-banner p {
    font-size: 0.88rem;
  }

  .banner-actions {
    width: 100%;
  }

  .banner-actions .btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .kpi-grid,
  .calc-row-2col,
  .result-comparison-grid,
  .menu-admin-grid,
  .ecosystem-grid,
  .flyers-showcase,
  .pricing-cards-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    padding: 15px 16px;
  }

  .kpi-value {
    font-size: 1.45rem;
  }

  .section-block {
    padding: 16px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
  }

  .section-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .view-mode-toggle {
    width: 100%;
    display: flex;
  }

  .view-btn {
    flex: 1;
    justify-content: center;
    text-align: center;
    padding: 10px 10px;
  }

  .search-panel {
    padding: 14px;
  }

  /* Evita auto-zoom no iOS Safari e melhora área de toque */
  .input-wrapper input,
  .search-input,
  .select-control,
  .sim-price-input {
    font-size: 1rem;
  }

  .filter-controls .select-control {
    flex: 1 1 100%;
    width: 100%;
  }

  .quick-chips-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .quick-chips-label,
  .chip-filter {
    flex-shrink: 0;
  }

  .results-meta-bar .formula-hint {
    display: none;
  }

  .buy-card-sim {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .buy-card-sim .sim-input-group {
    width: 100%;
  }

  .buy-card-sim .sim-price-wrapper {
    flex: 1;
    width: auto;
    min-height: 44px;
  }

  .comparator-form-card,
  .comparator-result-card {
    padding: 16px;
  }

  .calc-actions {
    flex-direction: column;
  }

  .calc-actions .btn {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }

  .footer-right {
    justify-content: center;
  }
}

/* Celulares Compactos (<= 480px) */
@media (max-width: 480px) {
  .login-screen {
    padding: 16px 12px;
  }

  .login-card {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .login-brand-title {
    font-size: 1.75rem;
  }

  .login-Showcase {
    height: 108px;
    margin-bottom: 16px;
  }

  .user-info {
    display: none;
  }

  .buy-card-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }

  .buy-metric-box strong {
    font-size: 0.94rem;
  }
}
