:root {
  /* Official Brand Palette from Color Standards */
  --brand-navy: #0B3C49;
  --brand-teal-dark: #00666B;
  --brand-teal-mid: #168B8D;
  --brand-orange-dark: #D9532F;
  --brand-orange-light: #F7A261;
  --brand-blue-slate: #5B8AC5;
  --brand-blue-sky: #77A9D8;
  --brand-dark: #231F20;

  /* UI Tokens - Decoupled Frontend Layer v2.0.0 */
  --g: #00666B;
  --g-hover: #168B8D;
  --d: #0B3C49;
  --bg: #F8FAFC;
  --card-bg: #FFFFFF;
  --border: #E2E8F0;
  --text-main: #231F20;
  --text-muted: #64748B;
  --r: #DC2626;
  --y: #F59E0B;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  background: #ffffff;
  border-bottom: 1.5px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  height: 60px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
  filter: contrast(1.05);
}

#who { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; flex-wrap: wrap; justify-content: flex-end; }

.stay-awake-btn {
  background: #f0fdf4;
  color: #15803d;
  border: 1.5px solid #86efac;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.stay-awake-btn:hover {
  background: #dcfce7;
  border-color: #4ade80;
  transform: translateY(-1px);
}
.stay-awake-btn.active {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
}

.feedback-center-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0;
  margin-bottom: -10px;
}
.feedback-center-logo {
  height: 120px;
  width: auto;
  max-width: 360px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
  filter: contrast(1.05);
}
.user-badge {
  background: #f1f5f9;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-navy);
  border: 1px solid var(--border);
  white-space: nowrap;
}

main {
  max-width: 1320px;
  width: 100%;
  margin: 16px auto;
  padding: 0 16px;
  flex: 1;
}

.card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 2px 10px rgba(11, 60, 73, 0.04);
  border: 1px solid var(--border);
}

h1, h2, h3 { color: var(--brand-navy); }
h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
}

.form-group { margin-bottom: 16px; text-align: left; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

input, select, textarea {
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  width: 100%;
  background: #ffffff;
  color: #0f172a;
  cursor: text;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-teal-dark);
  box-shadow: 0 0 0 3px rgba(0, 102, 107, 0.15);
}

button {
  font: inherit;
  background: var(--brand-teal-dark);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  width: auto;
  padding: 12px 20px;
  border-radius: 10px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: all 0.18s ease;
}

button:hover:not(:disabled) { background: var(--brand-teal-mid); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--brand-teal-dark); color: #fff; border: 0; }
.btn-secondary { background: #f1f5f9; color: var(--brand-navy); border: 1.5px solid #cbd5e1; }
.btn-secondary:hover:not(:disabled) { background: #e2e8f0; }
.btn-del { background: #fee2e2; color: var(--r); border: 1px solid #fecaca; }
.btn-del:hover:not(:disabled) { background: #fca5a5; color: #991b1b; }
.btn-warn { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.btn-warn:hover:not(:disabled) { background: #fde68a; }
.btn-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.btn-success:hover:not(:disabled) { background: #bbf7d0; }
.btn-sm { padding: 6px 12px; font-size: 13px; min-height: 34px; border-radius: 8px; }

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.row > * { flex: 1; min-width: 140px; }
.row > button { flex: 0 0 auto; white-space: nowrap; }

/* Login */
.login-card { max-width: 420px; margin: 40px auto; padding: 36px 28px; text-align: center; }
.login-header { margin-bottom: 24px; }
.login-logo { height: 72px; width: auto; max-width: 280px; margin-bottom: 14px; object-fit: contain; mix-blend-mode: multiply; }
.login-header h2 { margin: 0 0 6px; font-size: 22px; color: var(--brand-navy); font-weight: 800; }
.login-header p { margin: 0; font-size: 14px; color: var(--text-muted); }
.forgot-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-teal);
  text-decoration: none;
}
.forgot-link:hover {
  text-decoration: underline;
  color: var(--brand-teal-dark);
}
.err { color: var(--r); font-size: 14px; margin: 8px 0; font-weight: 700; min-height: 18px; text-align: center; }

/* Admin Nav */
.admin-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.nav-tab {
  background: #fff;
  color: #475569;
  border: 1.5px solid var(--border);
  padding: 10px 22px;
  font-weight: 700;
  border-radius: 10px;
}

.nav-tab.on {
  background: var(--brand-teal-dark);
  color: #fff;
  border-color: var(--brand-teal-dark);
  box-shadow: 0 2px 6px rgba(0, 102, 107, 0.25);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.stat-card b {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
  color: var(--brand-navy);
}

.stat-card span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.stat-card small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: normal;
}

/* Bars & Progress */
.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  font-size: 14px;
}

.bar span:first-child { width: 150px; font-weight: 700; color: #334155; }
.bar-val { font-weight: 800; width: 44px; text-align: right; color: var(--brand-navy); }
.bar i {
  display: block;
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--brand-teal-dark), var(--brand-teal-mid));
  transition: width 0.3s ease;
}

.bar .t {
  flex: 1;
  background: #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

/* ==========================================
   ADVANCED FEEDBACK ANALYTICS & CHARTS
   ========================================== */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.analytics-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.analytics-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Sentiment Distribution Stacked Bar */
.sentiment-bar-wrap {
  height: 22px;
  border-radius: 11px;
  background: #e2e8f0;
  display: flex;
  overflow: hidden;
  margin: 14px 0 16px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.sentiment-seg {
  height: 100%;
  transition: width 0.4s ease;
}
.seg-pos { background: linear-gradient(90deg, #10B981, #059669); }
.seg-neu { background: linear-gradient(90deg, #FBBF24, #D97706); }
.seg-neg { background: linear-gradient(90deg, #F87171, #DC2626); }

.sentiment-legend {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.sentiment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.sentiment-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

/* Rating Breakdown Row (1 to 5) */
.rating-dist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.rating-dist-label {
  width: 115px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #334155;
}

.rating-dist-bar-wrap {
  flex: 1;
  height: 12px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
}

.rating-dist-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.rating-dist-count {
  width: 70px;
  text-align: right;
  font-weight: 700;
  color: #64748b;
  font-size: 12px;
}

/* Smart Insights Box */
.insights-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.insights-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 8px;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #1e293b;
  line-height: 1.45;
}

.insight-item:last-child { margin-bottom: 0; }
.insight-icon { font-size: 16px; flex-shrink: 0; }

/* 14-Day Trend Chart */
.trend-chart-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  padding: 16px 8px 0;
  margin: 10px 0 6px;
  border-bottom: 2px solid #e2e8f0;
  overflow-x: auto;
}

.trend-col {
  flex: 1;
  min-width: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.trend-bar {
  width: 22px;
  background: linear-gradient(180deg, var(--brand-teal-mid) 0%, var(--brand-teal-dark) 100%);
  border-radius: 6px 6px 0 0;
  transition: height 0.4s ease;
  min-height: 4px;
}

.trend-bar:hover {
  background: linear-gradient(180deg, #38bdf8 0%, var(--brand-teal-dark) 100%);
}

.trend-label {
  font-size: 10px;
  color: #64748b;
  margin-top: 6px;
  white-space: nowrap;
  font-weight: 600;
}

.trend-val {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 4px;
}

/* SaaS Badges & Subscription Pills */
.plan-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.plan-enterprise { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.plan-pro { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.plan-standard { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.sub-active {
  background: #dcfce7;
  color: #15803d;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #bbf7d0;
}

.sub-expired {
  background: #fee2e2;
  color: #dc2626;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #fecaca;
  animation: pulseSub 2s infinite;
}

@keyframes pulseSub {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.renewal-banner {
  background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%);
  border: 2px solid #fca5a5;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.renewal-banner h3 {
  margin: 0 0 4px;
  color: #991b1b;
  font-size: 18px;
  font-weight: 800;
}

.renewal-banner p {
  margin: 0;
  color: #7f1d1d;
  font-size: 14px;
}


/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f8fafc;
  font-weight: 800;
  color: var(--brand-navy);
  white-space: nowrap;
}

.table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.table-header-row h2 { margin: 0; }

code {
  background: #f1f5f9;
  padding: 3px 7px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-navy);
}

.tag {
  padding: 4px 10px;
  border-radius: 99px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.tag-vgood { background: #059669; }
.tag-good { background: #16A34A; }
.tag-avg { background: #CA8A04; }
.tag-bad { background: #EA580C; }
.tag-vbad { background: #DC2626; }

.id-tag {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
}

.scale-badge {
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
}

.status-pill.active { background: #dcfce7; color: #15803d; }
.status-pill.disabled { background: #fee2e2; color: #b91c1c; }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ==========================================
   STEP 1: DYNAMIC MOVEABLE EMOJI SCREEN
   ========================================== */
.kiosk-container, .feedback-container {
  max-width: 820px;
  margin: 14px auto;
  text-align: center;
  width: 100%;
}

.kiosk-header, .feedback-header {
  margin-bottom: 24px;
}

.kiosk-cafe-name, .feedback-cafe-name {
  font-size: 34px;
  font-weight: 900;
  color: var(--brand-navy);
  margin: 0 0 10px;
  letter-spacing: -0.5px;
}

.kiosk-cafe-loc, .feedback-cafe-loc {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-teal-dark);
  margin-bottom: 12px;
}

.kiosk-step-pill, .feedback-step-pill {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 12px;
}

.kiosk-question, .feedback-question {
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 8px;
  letter-spacing: -0.4px;
}

.kiosk-sub, .feedback-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

/* High-Impact Emojis Grid (Worst to Best) */
.emo-grid {
  display: grid;
  gap: 16px;
  margin: 28px 0 32px;
  width: 100%;
}

.emo-5 { grid-template-columns: repeat(5, 1fr); }
.emo-3 { grid-template-columns: repeat(3, 1fr); max-width: 540px; margin-left: auto; margin-right: auto; }

/* Large Moveable Emoji Button */
.emo-btn {
  background: #ffffff;
  border: 3.5px solid var(--border);
  border-radius: 24px;
  padding: 22px 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  min-width: 90px;
  min-height: 150px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease,
              opacity 0.3s ease;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Soft Background Circle Behind Emoji */
.emo-bg-circle {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease;
}

.emo-icon-box {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: floatBreath 3s ease-in-out infinite;
}

.emo-btn:nth-child(2) .emo-icon-box { animation-delay: 0.3s; }
.emo-btn:nth-child(3) .emo-icon-box { animation-delay: 0.6s; }
.emo-btn:nth-child(4) .emo-icon-box { animation-delay: 0.9s; }
.emo-btn:nth-child(5) .emo-icon-box { animation-delay: 1.2s; }

/* Subtle Idle Floating Breathing Animation */
@keyframes floatBreath {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.svg-face {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.1));
}

.emo-label {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

/* ==========================================
   DYNAMIC ACTIONABLE HOVER ANIMATIONS
   ========================================== */
.emo-btn:hover {
  border-color: var(--rating-color);
  transform: translateY(-8px) scale(1.15);
  box-shadow: 0 14px 30px var(--glow-color);
  background: #ffffff;
}

.emo-btn:hover .emo-bg-circle {
  transform: scale(1.1);
}

/* 1. Very Bad: Angry Shake */
@keyframes angryShake {
  0%, 100% { transform: rotate(0deg) scale(1.1); }
  25% { transform: rotate(-6deg) scale(1.14); }
  75% { transform: rotate(6deg) scale(1.14); }
}
.emo-btn:hover .face-angry {
  animation: angryShake 0.4s ease infinite;
}

/* 2. Bad: Sad Droop */
@keyframes sadDroop {
  0%, 100% { transform: translateY(0) scale(1.08); }
  50% { transform: translateY(3px) scale(1.08); }
}
.emo-btn:hover .face-sad {
  animation: sadDroop 0.6s ease infinite;
}

/* 3. Average: Neutral Sway */
@keyframes neutralSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(4deg); }
}
.emo-btn:hover .face-neutral {
  animation: neutralSway 0.8s ease infinite;
}

/* 4. Good: Cheerful Nod */
@keyframes happyNod {
  0%, 100% { transform: translateY(0) scale(1.1); }
  50% { transform: translateY(-5px) scale(1.14); }
}
.emo-btn:hover .face-happy {
  animation: happyNod 0.5s ease infinite;
}

/* 5. Very Good: Excited Bounce & Heart Eyes Pulse */
@keyframes excitedBounce {
  0%, 100% { transform: translateY(0) scale(1.12); }
  40% { transform: translateY(-7px) scale(1.18); }
  70% { transform: translateY(2px) scale(1.1); }
}
@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.emo-btn:hover .face-love {
  animation: excitedBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}
.emo-btn:hover .heart-eyes {
  transform-origin: center;
  animation: heartPulse 0.4s ease infinite;
}

/* On Tap: Quick Pop & Glow */
@keyframes popBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  75% { transform: scale(1.16); }
  100% { transform: scale(1.22); }
}

.emo-btn.tapped-pop {
  animation: popBounce 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  border-color: var(--rating-color);
  box-shadow: 0 0 0 5px var(--rating-color), 0 16px 36px var(--glow-color);
  z-index: 10;
  background: #ffffff;
}

.emo-btn.tapped-pop .emo-bg-circle {
  transform: scale(1.18);
}

/* Other emojis fade out on tap */
.emo-btn.fade-out {
  opacity: 0.22;
  filter: grayscale(40%);
  transform: scale(0.92);
}

/* Selected Rating Badge in Step 2 & 3 */
.selected-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 99px;
  font-size: 15px;
  margin-top: 4px;
}

/* Step 2 & 3 Card */
.kiosk-card, .feedback-card {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
  padding: 28px 24px;
}

/* Stars Group */
.stars-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.star-rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.star-label {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  min-width: 170px;
}

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

.star-btn {
  font-size: 34px;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 2px;
}

.star-btn:hover {
  transform: scale(1.2);
  color: #f59e0b;
}

.star-btn.active {
  color: #f59e0b;
  text-shadow: 0 0 4px rgba(245, 158, 11, 0.4);
}

.star-score-text {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-navy);
  margin-left: 8px;
  min-width: 48px;
}

/* ID Type Toggle */
.id-type-toggle {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.type-btn {
  flex: 1;
  background: transparent;
  color: #64748b;
  border: 0;
  padding: 11px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 8px;
  min-height: 40px;
  transition: all 0.15s ease;
}

.type-btn.on {
  background: #ffffff;
  color: var(--brand-navy);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Feedback Actions */
.kiosk-actions, .feedback-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.kiosk-actions button, .feedback-actions button {
  flex: 1;
  padding: 14px;
  font-size: 16px;
  font-weight: 800;
  min-height: 50px;
}

#step2Back, #step3Back { flex: 0 0 100px; }

/* Thank You Screen */
.kiosk-thanks, .feedback-thanks {
  padding: 60px 20px;
  text-align: center;
}

.thanks-icon { font-size: 64px; margin-bottom: 16px; }
.thanks-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--brand-navy);
  margin: 0 0 10px;
}

.thanks-msg {
  font-size: 16px;
  color: #475569;
  margin: 0 0 20px;
}

.thanks-timer {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.link {
  background: none;
  color: var(--text-muted);
  padding: 0;
  border: 0;
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
  min-height: auto;
}

/* ==========================================
   MOBILE SCREEN RESPONSIVENESS (< 640px)
   ========================================== */
@media (max-width: 640px) {
  header {
    padding: 8px 14px;
  }
  .logo {
    height: 38px;
    max-width: 130px;
  }
  #who {
    font-size: 12px;
    gap: 6px;
  }
  .user-badge {
    padding: 4px 8px;
    font-size: 11px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .feedback-center-logo {
    height: 95px;
    max-width: 280px;
  }
  .feedback-center-logo-wrap {
    margin-bottom: -6px;
  }

  .kiosk-cafe-name { font-size: 26px; }
  .kiosk-question { font-size: 22px; }
  .kiosk-sub { font-size: 13px; }

  /* Mobile Grid (Worst to Best Order Maintained) */
  .emo-5 {
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: 10px;
  }
  .emo-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .emo-btn {
    padding: 14px 6px 12px;
    border-radius: 18px;
    min-height: 125px;
    min-width: 80px;
    border-width: 2.5px;
  }

  .emo-bg-circle {
    width: 64px;
    height: 64px;
  }

  .emo-icon-box {
    width: 54px;
    height: 54px;
  }

  .emo-label {
    font-size: 12px;
  }

  .kiosk-card {
    padding: 20px 16px;
  }

  .star-label {
    min-width: 100%;
    margin-bottom: 4px;
  }

  .star-items {
    width: 100%;
    justify-content: space-between;
  }

  .star-btn {
    font-size: 30px;
  }

  .kiosk-actions {
    flex-direction: column-reverse;
  }

  #step2Back, #step3Back {
    flex: 1;
    width: 100%;
  }

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

/* ==========================================
   MODAL WINDOW & POPUP DIALOGS
   ========================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 60, 73, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
  animation: fadeInModal 0.2s ease-out;
}

.modal-window {
  background: #ffffff;
  border-radius: 20px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 24px 50px rgba(11, 60, 73, 0.25), 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1.5px solid var(--border);
  animation: scaleInModal 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  text-align: left;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleInModal {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #f1f5f9;
}

.modal-header h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--brand-navy);
}

.modal-close {
  background: #f1f5f9;
  color: #64748b;
  border: none;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: rotate(90deg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1.5px solid #f1f5f9;
}

.modal-footer button {
  min-width: 100px;
}

/* Plan Badges & Presets */
.plan-trial { background: #fdf2f8; color: #db2777; border: 1px solid #fbcfe8; }

.preset-pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.preset-pill {
  background: #f8fafc;
  color: #475569;
  border: 1.5px solid #cbd5e1;
  padding: 6px 13px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: auto;
  transition: all 0.15s ease;
}

.preset-pill:hover {
  background: #e2e8f0;
  color: var(--brand-navy);
  transform: translateY(-1px);
}

.preset-pill.active {
  background: #00666b;
  color: #ffffff;
  border-color: #00666b;
  box-shadow: 0 2px 6px rgba(0, 102, 107, 0.25);
}

/* Logo Upload & Preview */
.logo-upload-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 12px;
  border: 1.5px dashed #cbd5e1;
  margin-bottom: 16px;
}

.logo-preview-box {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 10px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.logo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.logo-placeholder {
  font-size: 24px;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo-upload-controls {
  flex: 1;
}

.logo-upload-controls label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  display: block;
  margin-bottom: 6px;
}

.logo-btn-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: var(--brand-navy);
  border: 1.5px solid #cbd5e1;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.logo-btn-file:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.logo-clear-btn {
  background: transparent;
  color: #dc2626;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
  min-height: auto;
  text-decoration: underline;
}

.logo-clear-btn:hover {
  background: transparent;
  color: #991b1b;
  transform: none;
}

/* Table Enhancements */
.saas-table {
  min-width: 980px;
}

.saas-table th, .saas-table td {
  vertical-align: middle;
}

.saas-table td code {
  font-size: 12px;
}

.merchant-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.merchant-table-logo {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.merchant-table-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  color: #0369a1;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bae6fd;
}


