/* ── Interactive Demo ── */
.demo-wrap {
  max-width: 880px; margin: 60px auto 0;
  position: relative;
}
.demo-label {
  text-align: center; font-size: 0.8rem; font-weight: 600;
  color: rgba(255,255,255,0.4); margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.demo {
  border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
  background: #f0f0f5;
  position: relative;
  user-select: none;
}

/* Header */
.demo-header {
  background: #002D62;
  display: flex; align-items: center; gap: 0;
  padding: 0 16px; height: 40px;
  font-size: 0.72rem; color: rgba(255,255,255,0.6);
}
.demo-brand {
  font-weight: 800; font-size: 0.85rem; color: #fff;
  margin-right: 20px;
}
.demo-brand span { color: #C21A1A; }
.demo-tab {
  padding: 0 14px; height: 40px;
  display: flex; align-items: center;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.demo-tab:hover { color: rgba(255,255,255,0.9); }
.demo-tab.active {
  background: #C21A1A; color: #fff; font-weight: 700;
  border-radius: 4px 4px 0 0;
}
.demo-store {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  padding: 4px 10px; border-radius: 4px;
  font-size: 0.65rem;
}

/* Panel switching */
.demo-panel { display: none; }
.demo-panel.active { display: block; }

/* Body (register panel) */
.demo-body {
  display: grid;
  grid-template-columns: 90px 1fr 220px;
  height: 340px;
}

/* Sidebar categories */
.demo-sidebar {
  background: #002D62;
  padding: 8px 0;
  border-right: 1px solid rgba(0,0,0,0.1);
}
.demo-cat {
  padding: 7px 12px;
  font-size: 0.68rem; color: rgba(255,255,255,0.6);
  cursor: pointer; transition: all 0.15s;
  text-align: center;
}
.demo-cat:hover { background: rgba(255,255,255,0.1); color: #fff; }
.demo-cat.active {
  background: #C21A1A; color: #fff;
  font-weight: 700;
}

/* Product grid */
.demo-products {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  overflow-y: auto;
  align-content: start;
  background: #e8e8ed;
}
.demo-product {
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
  border: 1px solid rgba(0,0,0,0.06);
}
.demo-product:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.demo-product:active { transform: scale(0.97); }
.demo-product-price {
  font-size: 0.75rem; font-weight: 800;
  color: #002D62; margin-bottom: 2px;
}
.demo-product-emoji {
  font-size: 1.6rem;
  line-height: 1.3;
}
.demo-product-name {
  font-size: 0.58rem; color: #333;
  line-height: 1.2; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-product-stock {
  font-size: 0.5rem; color: #888;
  margin-top: 2px;
}
.demo-product-ebt {
  font-size: 0.45rem; color: #2ecc71;
  font-weight: 700; margin-top: 1px;
}
.demo-product-add {
  display: block; width: 100%;
  margin-top: 4px; padding: 3px 0;
  background: #2ecc71; color: #fff;
  border: none; border-radius: 4px;
  font-size: 0.6rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.demo-product-add:hover { background: #27ae60; }

/* Cart */
.demo-cart {
  background: #fff;
  border-left: 1px solid rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  padding: 10px;
}
.demo-cart-title {
  font-size: 0.75rem; font-weight: 700;
  color: #002D62; margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #002D62;
}
.demo-cart-items {
  flex: 1; overflow-y: auto;
  min-height: 0;
}
.demo-cart-empty {
  text-align: center; padding: 30px 0;
  font-size: 0.7rem; color: #999;
}
.demo-cart-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 0.65rem;
  animation: cartSlide 0.2s ease;
}
@keyframes cartSlide {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}
.demo-cart-item-name {
  flex: 1; color: #333;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-cart-item-qty {
  background: #eee; padding: 1px 6px;
  border-radius: 3px; font-weight: 700;
  font-size: 0.6rem; color: #002D62;
}
.demo-cart-item-price {
  font-weight: 700; color: #002D62;
  min-width: 40px; text-align: right;
}
.demo-cart-item-remove {
  background: none; border: none;
  color: #ccc; cursor: pointer;
  font-size: 0.8rem; padding: 0 2px;
  transition: color 0.15s;
}
.demo-cart-item-remove:hover { color: #e74c3c; }

.demo-cart-total {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-top: 2px solid #002D62;
  margin-top: 6px;
  font-size: 0.85rem; font-weight: 800;
  color: #002D62;
}
.demo-pay-btns {
  display: flex; gap: 4px; margin: 6px 0;
}
.demo-pay {
  flex: 1; padding: 5px 0;
  background: #eee; border: 1px solid #ddd;
  border-radius: 4px; font-size: 0.6rem;
  font-weight: 600; cursor: pointer;
  color: #333; font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
.demo-pay.active {
  background: #002D62; color: #fff; border-color: #002D62;
}
.demo-checkout {
  width: 100%; padding: 8px 0;
  background: #C21A1A; color: #fff;
  border: none; border-radius: 6px;
  font-size: 0.75rem; font-weight: 700;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}
.demo-checkout:hover:not(:disabled) { background: #a81616; }
.demo-checkout:disabled { opacity: 0.4; cursor: default; }

/* Status bar */
.demo-status {
  background: #002D62;
  padding: 6px 16px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.6rem; color: rgba(255,255,255,0.5);
}
.demo-status-badge {
  background: #C21A1A; color: #fff;
  padding: 1px 6px; border-radius: 3px;
  font-size: 0.5rem; font-weight: 700;
}
.demo-status-time { margin-left: auto; }

/* Checkout success overlay */
.demo-success {
  position: absolute; inset: 0;
  background: rgba(0,45,98,0.95);
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 10;
  animation: fadeIn 0.2s ease;
}
.demo-success.show { display: flex; }
.demo-success-icon {
  width: 60px; height: 60px;
  background: #2ecc71; color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700;
  margin-bottom: 16px;
}
.demo-success-text {
  font-size: 1.4rem; font-weight: 800;
  color: #fff; margin-bottom: 4px;
}
.demo-success-amount {
  font-size: 2rem; font-weight: 800;
  color: #2ecc71;
}
.demo-success-sub {
  font-size: 0.75rem; color: rgba(255,255,255,0.5);
  margin-top: 8px;
}

/* ── Dashboard Panel ── */
.demo-dash { padding: 14px; height: 340px; overflow-y: auto; background: #f0f0f5; }
.demo-dash-period { display: flex; gap: 4px; margin-bottom: 12px; }
.demo-period { padding: 4px 12px; border: 1px solid #ddd; background: #fff; border-radius: 4px; font-size: 0.6rem; font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif; color: #333; }
.demo-period.active { background: #002D62; color: #fff; border-color: #002D62; }
.demo-dash-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 14px; }
.demo-stat-card { background: #fff; border-radius: 8px; padding: 10px 12px; border-left: 3px solid #002D62; }
.demo-stat-card-label { font-size: 0.55rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.demo-stat-card-value { font-size: 1.1rem; font-weight: 800; color: #002D62; }
.demo-stat-card-value.warn { color: #e74c3c; }
.demo-stat-card-change { font-size: 0.55rem; color: #888; }
.demo-stat-card-change.up { color: #2ecc71; }
.demo-stat-card-change.down { color: #e74c3c; }
.demo-dash-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; }
.demo-dash-chart, .demo-dash-top { background: #fff; border-radius: 8px; padding: 12px; }
.demo-chart-title { font-size: 0.65rem; font-weight: 700; color: #002D62; margin-bottom: 10px; }
.demo-chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.demo-bar { flex: 1; background: #002D62; border-radius: 4px 4px 0 0; min-height: 4px; position: relative; transition: height 0.5s ease; opacity: 0.6; }
.demo-bar.active { background: #C21A1A; opacity: 1; }
.demo-bar span { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); font-size: 0.5rem; color: #888; }
.demo-top-list { display: flex; flex-direction: column; gap: 2px; }
.demo-top-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 0.65rem; }
.demo-top-rank { width: 18px; height: 18px; background: #002D62; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.5rem; font-weight: 700; flex-shrink: 0; }
.demo-top-name { flex: 1; color: #333; }
.demo-top-rev { font-weight: 700; color: #002D62; }

/* ── Inventory Panel ── */
.demo-inv { padding: 14px; height: 340px; overflow-y: auto; background: #f0f0f5; }
.demo-inv-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.demo-inv-search { flex: 1; padding: 7px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.7rem; font-family: 'Inter', sans-serif; outline: none; }
.demo-inv-search:focus { border-color: #002D62; }
.demo-inv-count { font-size: 0.6rem; color: #888; white-space: nowrap; }
.demo-inv-table { background: #fff; border-radius: 8px; overflow: hidden; }
.demo-inv-head { display: grid; grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr; padding: 8px 12px; background: #002D62; color: #fff; font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.demo-inv-row { display: grid; grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr; padding: 7px 12px; font-size: 0.62rem; color: #333; border-bottom: 1px solid #f0f0f0; }
.demo-inv-row:hover { background: #f8f8fb; }
.demo-inv-row .low { color: #e74c3c; font-weight: 700; }
.demo-inv-row .ok { color: #2ecc71; font-weight: 600; }
.demo-inv-row .margin { color: #002D62; font-weight: 600; }

/* ── AI Assistant Panel ── */
.demo-ai { display: flex; flex-direction: column; height: 340px; background: #f0f0f5; }
.demo-ai-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.demo-ai-msg { padding: 10px 14px; border-radius: 10px; font-size: 0.7rem; line-height: 1.5; max-width: 85%; animation: cartSlide 0.2s ease; }
.demo-ai-msg.system { background: #fff; color: #333; align-self: flex-start; border: 1px solid #e0e0e0; }
.demo-ai-msg.user { background: #002D62; color: #fff; align-self: flex-end; }
.demo-ai-msg.assistant { background: #fff; color: #333; align-self: flex-start; border: 1px solid #e0e0e0; }
.demo-ai-msg .typing { display: inline-block; }
.demo-ai-msg .typing::after { content: '|'; animation: blink 0.6s infinite; color: #002D62; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.demo-ai-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.demo-ai-suggest { padding: 5px 10px; background: #fff; border: 1px solid #ddd; border-radius: 20px; font-size: 0.58rem; color: #002D62; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.15s; }
.demo-ai-suggest:hover { background: #002D62; color: #fff; border-color: #002D62; }
.demo-ai-input { display: flex; gap: 6px; padding: 10px 14px; background: #fff; border-top: 1px solid #e0e0e0; }
.demo-ai-input input { flex: 1; padding: 7px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.7rem; font-family: 'Inter', sans-serif; outline: none; }
.demo-ai-input input:focus { border-color: #002D62; }
.demo-ai-input button { padding: 7px 16px; background: #002D62; color: #fff; border: none; border-radius: 6px; font-size: 0.65rem; font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif; }
.demo-ai-input button:hover { background: #001d42; }

/* ── Kitchen Panel ── */
.demo-kitchen { padding: 14px; height: 340px; overflow-y: auto; background: #1a1a2e; }
.demo-kitchen-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.demo-kitchen-title { font-size: 0.8rem; font-weight: 700; color: #fff; }
.demo-kitchen-count { font-size: 0.6rem; color: rgba(255,255,255,0.5); }
.demo-kitchen-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.demo-order { background: rgba(255,255,255,0.06); border-radius: 8px; padding: 12px; border-left: 3px solid #888; transition: opacity 0.4s ease, transform 0.4s ease; }
.demo-order.new { border-color: #e74c3c; }
.demo-order.progress { border-color: #f39c12; }
.demo-order.ready { border-color: #2ecc71; }
.demo-order.done { opacity: 0; transform: scale(0.95); }
.demo-order-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.demo-order-num { font-size: 0.8rem; font-weight: 800; color: #fff; }
.demo-order-time { font-size: 0.55rem; color: rgba(255,255,255,0.4); }
.demo-order-badge { margin-left: auto; padding: 2px 8px; border-radius: 4px; font-size: 0.45rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.demo-order-badge.new { background: rgba(231,76,60,0.2); color: #e74c3c; }
.demo-order-badge.progress { background: rgba(243,156,18,0.2); color: #f39c12; }
.demo-order-badge.ready { background: rgba(46,204,113,0.2); color: #2ecc71; }
.demo-order-items { margin-bottom: 8px; }
.demo-order-items div { font-size: 0.65rem; color: rgba(255,255,255,0.7); padding: 2px 0; }
.demo-order-btn { width: 100%; padding: 5px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); color: #fff; border-radius: 4px; font-size: 0.6rem; font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif; transition: background 0.15s; }
.demo-order-btn:hover { background: rgba(255,255,255,0.2); }

/* ── Flyers Panel ── */
.demo-flyers { display: grid; grid-template-columns: 140px 1fr; height: 340px; background: #f0f0f5; }
.demo-flyer-sidebar { background: #fff; border-right: 1px solid #e0e0e0; padding: 12px; display: flex; flex-direction: column; }
.demo-flyer-label { font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #888; margin-bottom: 8px; }
.demo-flyer-tmpl { padding: 6px 8px; font-size: 0.65rem; color: #333; border-radius: 4px; cursor: pointer; margin-bottom: 2px; transition: background 0.15s; }
.demo-flyer-tmpl:hover { background: #f0f0f5; }
.demo-flyer-tmpl.active { background: #002D62; color: #fff; font-weight: 600; }
.demo-flyer-export { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.demo-flyer-btn { padding: 6px; border: none; border-radius: 4px; font-size: 0.6rem; font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif; background: #C21A1A; color: #fff; }
.demo-flyer-btn.outline { background: #fff; color: #002D62; border: 1px solid #ddd; }
.demo-flyer-preview { display: flex; align-items: center; justify-content: center; padding: 16px; }
.demo-flyer-page {
  width: 220px; background: #fff; border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12); overflow: hidden;
  border: 1px solid #e0e0e0;
}
.demo-flyer-header-bar {
  background: #C21A1A; color: #fff; text-align: center;
  padding: 8px; font-size: 0.75rem; font-weight: 800;
  letter-spacing: 1px;
}
.demo-flyer-store-name {
  text-align: center; padding: 6px; font-size: 0.6rem;
  color: #002D62; font-weight: 700;
}
.demo-flyer-items { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
.demo-flyer-item {
  text-align: center; padding: 8px 4px;
  background: #f8f8fb; border-radius: 6px;
  border: 1px solid #eee;
}
.demo-flyer-item-emoji { font-size: 1.4rem; }
.demo-flyer-item-name { font-size: 0.55rem; color: #333; margin-top: 2px; font-weight: 600; }
.demo-flyer-item-price { font-size: 0.8rem; font-weight: 800; color: #C21A1A; margin-top: 2px; }
.demo-flyer-footer {
  text-align: center; padding: 6px;
  font-size: 0.5rem; color: #888;
  border-top: 1px solid #eee;
}

/* ── Customer Display Panel ── */
.demo-customer { height: 340px; background: #0a0a14; display: flex; flex-direction: column; }
.demo-cust-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.demo-cust-promo { text-align: center; animation: fadeIn 0.5s ease; transition: opacity 0.3s ease; }
.demo-cust-promo-title { font-size: 0.65rem; color: #C21A1A; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
.demo-cust-promo-item { font-size: 1.8rem; font-weight: 800; color: #fff; margin-bottom: 4px; }
.demo-cust-promo-price { font-size: 2.5rem; font-weight: 800; color: #2ecc71; }
.demo-cust-promo-note { font-size: 0.7rem; color: rgba(255,255,255,0.4); margin-top: 8px; }
.demo-cust-brand { text-align: center; padding: 16px; margin-top: 20px; }
.demo-cust-logo { font-size: 1.2rem; font-weight: 800; color: #fff; }
.demo-cust-logo span { color: #C21A1A; }
.demo-cust-tagline { font-size: 0.65rem; color: rgba(255,255,255,0.3); margin-top: 4px; }
.demo-cust-note { padding: 10px 16px; background: rgba(192,57,43,0.1); border-top: 1px solid rgba(192,57,43,0.2); font-size: 0.62rem; color: rgba(255,255,255,0.5); text-align: center; }

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

/* ── Responsive ── */
@media (max-width: 768px) {
  .demo-body { grid-template-columns: 70px 1fr 180px; height: 300px; }
  .demo-products { grid-template-columns: repeat(3, 1fr); }
  .demo-cat { font-size: 0.6rem; padding: 6px 8px; }
  .demo-dash-stats { grid-template-columns: repeat(2, 1fr); }
  .demo-dash-grid { grid-template-columns: 1fr; }
  .demo-kitchen-board { grid-template-columns: 1fr; }
  .demo-inv-head, .demo-inv-row { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .demo-inv-head span:nth-child(3), .demo-inv-head span:nth-child(4),
  .demo-inv-row span:nth-child(3), .demo-inv-row span:nth-child(4) { display: none; }
  .demo-header { overflow-x: auto; }
  .demo-tab { white-space: nowrap; font-size: 0.6rem; }
}
@media (max-width: 480px) {
  .demo-body { grid-template-columns: 1fr; height: auto; }
  .demo-sidebar { display: flex; overflow-x: auto; padding: 4px; gap: 4px; }
  .demo-products { grid-template-columns: repeat(3, 1fr); height: 200px; }
  .demo-cart { border-left: none; border-top: 1px solid rgba(0,0,0,0.08); }
}
