/* ==========================================================================
   KIURCODE QRs — Dynamic QR Spreadsheet & Analytics on Cloudflare
   ========================================================================== */

:root {
  --kc-green-dark: #4C6517;
  --kc-green-base: #5F7D1F;
  --kc-green-mid: #7FA231;
  --kc-green-bright: #9BCA34;
  --kc-green-soft: rgba(155, 202, 52, 0.14);

  --bg-main: #F3F5F8;
  --bg-surface: #FFFFFF;
  --bg-dark: #0F1419;
  --bg-dark-elevated: #182028;

  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;

  --border-light: #E2E8F0;
  --border-focus: #7FA231;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-card: 0 4px 20px -2px rgba(15, 20, 25, 0.06), 0 2px 6px -1px rgba(15, 20, 25, 0.04);
  --shadow-elevated: 0 14px 34px -6px rgba(15, 20, 25, 0.14);
}

* {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-display {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   TOP NAVBAR & HERO ENTRANCE
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 20, 25, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  padding: 14px 24px;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #FFFFFF;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--kc-green-base), var(--kc-green-bright));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0F1419;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(155, 202, 52, 0.35);
}

.brand-text h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  color: #FFFFFF;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #94A3B8;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #CBD5E1;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.nav-tab:active {
  transform: scale(0.96);
}

.nav-tab.active {
  background: var(--kc-green-bright);
  color: #0F1419;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(155, 202, 52, 0.3);
}

.nav-tab .tab-count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(15, 20, 25, 0.18);
  font-weight: 700;
}

/* Save status & quick actions */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: #CBD5E1;
  background: rgba(255, 255, 255, 0.06);
  padding: 7px 13px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.save-status.saving {
  color: #FDE047;
  border-color: rgba(253, 224, 71, 0.3);
}

.save-status.saved {
  color: #A3E635;
}

/* ==========================================================================
   LIVING BUTTONS & MICROINTERACTIONS (KIUR CODE STYLE)
   ========================================================================== */

.btn-live-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #FFFFFF;
  background: linear-gradient(120deg, #5F7D1F 0%, #7FA231 35%, #9BCA34 50%, #7FA231 65%, #4C6517 100%);
  background-size: 220% 100%;
  box-shadow: 0 8px 22px -6px rgba(127, 162, 49, 0.75);
  animation: liveFlow 4s ease-in-out infinite, liveGlow 2.8s ease-in-out infinite;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 100px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.btn-live-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.75) 48%, rgba(255, 255, 255, 0.2) 55%, transparent 70%);
  transform: translateX(-130%);
  animation: liveSheen 3.2s ease-in-out infinite;
}

.btn-live-cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px -6px rgba(127, 162, 49, 0.9);
}

.btn-live-cta:active {
  transform: scale(0.96);
}

.dotlive {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  display: inline-block;
  animation: dotPulse 1.6s infinite;
}

@keyframes liveFlow { 50% { background-position: 100% 0; } }
@keyframes liveGlow {
  50% { box-shadow: 0 12px 28px -4px rgba(127, 162, 49, 0.95); }
}
@keyframes liveSheen {
  0%, 55% { transform: translateX(-130%); }
  85%, 100% { transform: translateX(130%); }
}
@keyframes dotPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.btn:active {
  transform: scale(0.96);
}

.btn-dark {
  background: var(--bg-dark);
  color: #FFFFFF;
  border-color: var(--bg-dark);
}

.btn-dark:hover {
  background: #1E293B;
  border-color: #1E293B;
}

.btn-icon {
  padding: 7px;
  border-radius: 8px;
  color: var(--text-secondary);
}

.btn-icon:hover {
  color: var(--kc-green-base);
  background: var(--kc-green-soft);
  border-color: rgba(127, 162, 49, 0.3);
}

/* ==========================================================================
   HERO ENTRANCE & SCROLL REVEAL
   ========================================================================== */

.hero-title, .hero-desc, .hero-ctas, .hero-visual {
  animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-title  { animation-delay: 0.05s; }
.hero-desc   { animation-delay: 0.12s; }
.hero-ctas   { animation-delay: 0.18s; }
.hero-visual { animation-delay: 0.25s; }

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

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   MAIN CONTAINER & HEADER BAR
   ========================================================================== */

.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* Latest Scan Live Strip */
.live-scan-banner {
  background: linear-gradient(90deg, #111827 0%, #1E293B 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--kc-green-bright);
}

.live-scan-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.live-scan-key {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  background: rgba(155, 202, 52, 0.2);
  color: var(--kc-green-bright);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(155, 202, 52, 0.35);
}

/* ==========================================================================
   SPREADSHEET CONTROLS & BASE PAGE CONFIG
   ========================================================================== */

.sheet-header-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
  border: 1px solid var(--border-light);
}

.sheet-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.sheet-title-group h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.sheet-title-group p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Base Page Bar (Row 1 in Google Sheets) */
.base-page-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.base-page-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.base-page-input {
  flex: 1;
  min-width: 240px;
  padding: 8px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-primary);
  background: #FFFFFF;
}

.base-page-input:focus {
  outline: none;
  border-color: var(--kc-green-mid);
  box-shadow: 0 0 0 3px rgba(127, 162, 49, 0.15);
}

/* Filter & Search Toolbar */
.sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 440px;
}

.search-box svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 14px;
  background: #F8FAFC;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--kc-green-mid);
  box-shadow: 0 0 0 3px rgba(127, 162, 49, 0.15);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid var(--border-light);
  background: #F8FAFC;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-btn:hover {
  border-color: #CBD5E1;
  color: var(--text-primary);
  transform: translateY(-1px);
}

.filter-btn:active {
  transform: scale(0.96);
}

.filter-btn.active {
  background: var(--bg-dark);
  color: #FFFFFF;
  border-color: var(--bg-dark);
}

/* ==========================================================================
   GOOGLE SHEETS-STYLE EDITABLE TABLE
   ========================================================================== */

.spreadsheet-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.spreadsheet-scroll {
  overflow-x: auto;
  width: 100%;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 960px;
}

.sheet-table th {
  background: #F8FAFC;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border-light);
  border-right: 1px solid #EEF2F6;
  user-select: none;
}

.sheet-table td {
  padding: 0;
  border-bottom: 1px solid #EEF2F6;
  border-right: 1px solid #EEF2F6;
  vertical-align: middle;
  background: #FFFFFF;
  transition: background-color 0.15s ease;
}

.sheet-table tr:hover td {
  background: #FAFDF6;
}

.sheet-table tr.row-assigned td:first-child {
  border-left: 3px solid var(--kc-green-mid);
}

.sheet-table tr.row-unassigned-hit td {
  background: #FEFCE8;
}

.sheet-table tr.row-highlight td {
  animation: rowFlash 2.2s ease;
}

@keyframes rowFlash {
  0%, 30% { background-color: rgba(155, 202, 52, 0.32); }
  100% { background-color: transparent; }
}

/* Column widths */
.col-idx { width: 46px; text-align: center !important; }
.col-key { width: 135px; }
.col-qr  { width: 92px; text-align: center !important; }
.col-url { width: auto; }
.col-place { width: 250px; }
.col-hits { width: 110px; text-align: center !important; }
.col-actions { width: 130px; text-align: center !important; }

.cell-idx {
  text-align: center;
  font-size: 12px;
  color: #94A3B8;
  font-family: 'JetBrains Mono', monospace;
  background: #F8FAFC !important;
  user-select: none;
}

.cell-key-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 6px;
}

.key-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #CBD5E1;
  flex-shrink: 0;
}

.status-dot.active {
  background: var(--kc-green-mid);
  box-shadow: 0 0 0 3px rgba(127, 162, 49, 0.18);
}

.status-dot.alert {
  background: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

/* Mini QR preview in row */
.cell-qr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  margin: 4px auto;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cell-qr-btn:hover {
  transform: scale(1.12);
  border-color: var(--kc-green-mid);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cell-qr-btn:active {
  transform: scale(0.96);
}

.cell-qr-btn canvas,
.cell-qr-btn img {
  width: 38px;
  height: 38px;
  display: block;
}

/* Editable Spreadsheet Inputs */
.cell-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 48px;
}

.platform-badge {
  position: absolute;
  left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 11px;
  pointer-events: none;
  color: #64748B;
  background: #F1F5F9;
}

.platform-badge.google { color: #EA4335; background: rgba(234, 67, 53, 0.1); }
.platform-badge.instagram { color: #E1306C; background: rgba(225, 48, 108, 0.1); }
.platform-badge.whatsapp { color: #16A34A; background: rgba(22, 163, 74, 0.12); }
.platform-badge.facebook { color: #1877F2; background: rgba(24, 119, 242, 0.1); }

.sheet-input {
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  background: transparent;
  font-family: inherit;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.sheet-input.url-input {
  padding-left: 42px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
}

.sheet-input::placeholder {
  color: #CBD5E1;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.sheet-input:focus {
  outline: none;
  border-color: var(--kc-green-mid);
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px var(--kc-green-mid);
  z-index: 2;
}

.sheet-input.just-saved {
  animation: savedCellPulse 1.2s ease;
}

@keyframes savedCellPulse {
  0% { background-color: rgba(155, 202, 52, 0.25); }
  100% { background-color: transparent; }
}

/* Hits pill inside row */
.hits-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 100px;
  border: 1px solid var(--border-light);
  background: #F8FAFC;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hits-pill-btn.has-hits {
  background: var(--kc-green-soft);
  color: var(--kc-green-dark);
  border-color: rgba(127, 162, 49, 0.35);
}

.hits-pill-btn:hover {
  transform: translateY(-1px);
  background: var(--kc-green-bright);
  color: #0F1419;
}

.hits-pill-btn:active {
  transform: scale(0.96);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
}

/* ==========================================================================
   ANALYTICS DASHBOARD VIEW
   ========================================================================== */

.analytics-filters-bar {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filters-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-select {
  min-width: 240px;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: #F8FAFC;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--kc-green-mid);
  background: #FFFFFF;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  word-break: break-word;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

.panel-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  margin-bottom: 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.panel-header h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.chart-box {
  position: relative;
  height: 320px;
  width: 100%;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid #EEF2F6;
  font-size: 14px;
}

.analytics-table th {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #F8FAFC;
}

/* ==========================================================================
   MODALS (QR PREVIEW / DOWNLOAD & CSV IMPORT / UNASSIGNED SCAN)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 25, 0.65);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--shadow-elevated);
  border: 1px solid var(--border-light);
  animation: heroFadeUp 0.25s ease both;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
}

.qr-preview-stage {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-bottom: 18px;
}

.qr-preview-stage canvas {
  max-width: 240px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   FLOATING ACTION BUTTON (ALWAYS VISIBLE ON DESKTOP & MOBILE)
   ========================================================================== */

.fab-container {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.fab-btn {
  height: 52px;
  padding: 0 20px;
  border-radius: 100px;
  font-size: 14px;
  box-shadow: 0 12px 28px -4px rgba(95, 125, 31, 0.85);
}

/* ==========================================================================
   PRINTABLE QR STICKER GRID
   ========================================================================== */

.print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 16px;
}

.print-qr-item {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.print-qr-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

.print-qr-place {
  font-size: 12px;
  color: #64748B;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media print {
  .topbar, .live-scan-banner, .fab-container, .no-print {
    display: none !important;
  }
  .main-container {
    padding: 0;
  }
  .print-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (< 850px and < 576px)
   ========================================================================== */

@media (max-width: 850px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .main-container {
    padding: 14px;
  }
  .topbar {
    padding: 12px 14px;
  }
}

@media (max-width: 576px) {
  .sheet-actions {
    width: 100%;
  }
  .sheet-actions .btn,
  .sheet-actions .btn-live-cta {
    width: 100%;
    min-height: 48px;
  }
  .nav-tabs {
    width: 100%;
    justify-content: space-between;
  }
  .nav-tab {
    flex: 1;
    justify-content: center;
    padding: 10px 8px;
    font-size: 13px;
  }
  .fab-container {
    right: 14px;
    bottom: 14px;
  }
  .fab-btn {
    height: 48px;
    padding: 0 16px;
  }
}
