:root {
  --bg: #f6f8fc;
  --bg-2: #eef4ff;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --line: #dbe4f0;
  --text: #122033;
  --muted: #667085;
  --cyan: #2563eb;
  --pink: #7c3aed;
  --green: #059669;
  --yellow: #d97706;
  --red: #dc2626;
  --shadow: 0 16px 42px rgba(15, 23, 42, .08);
  --radius: 22px;
  --radius-sm: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100%; margin: 0; color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(37,99,235,.12), transparent 28%),
    radial-gradient(circle at 92% 4%, rgba(124,58,237,.10), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f6f8fc 44%, #eef4ff 100%);
  padding-bottom: 104px;
}

.bg-grid {
  position: fixed; inset: 0; pointer-events: none; opacity: .45;
  background-image: linear-gradient(rgba(37,99,235,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(37,99,235,.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 70%);
}

.app-shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 26px 0 0; }
.app-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.brand-wrap { display: flex; gap: 16px; align-items: center; }
.brand-orb {
  width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; font-size: 31px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; box-shadow: 0 12px 30px rgba(37,99,235,.20);
}
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); font-weight: 900; }
h1 { margin: 0; font-size: clamp(32px, 5.4vw, 54px); line-height: 1; letter-spacing: -0.055em; color: #111827; }
h2 { margin: 0; font-size: clamp(21px, 3vw, 28px); letter-spacing: -0.03em; color: #111827; }
h3 { margin: 0 0 12px; font-size: 18px; color: #111827; }
.subhead { margin: 10px 0 0; color: #475467; max-width: 760px; line-height: 1.5; }
.header-tools { display: grid; gap: 10px; justify-items: end; min-width: 210px; }
.clock-card, .status-pill {
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font-weight: 900;
  background: rgba(255,255,255,.88); box-shadow: 0 10px 26px rgba(15,23,42,.06);
}
.clock-card { color: var(--pink); }
.status-pill.online { color: var(--green); border-color: rgba(5,150,105,.25); background: #ecfdf5; }
.status-pill.warning { color: var(--yellow); border-color: rgba(217,119,6,.25); background: #fffbeb; }
.status-pill.error { color: var(--red); border-color: rgba(220,38,38,.25); background: #fef2f2; }

.hidden { display: none !important; }
.main-content { display: block; }
.page { display: none; animation: rise .2s ease; }
.page.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.setup-warning, .panel, .summary-card, .primary-cta {
  border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow);
}
.setup-warning { border-radius: var(--radius); padding: 18px; margin: 20px 0; }
.setup-warning p { color: var(--muted); }
code { background: #eef2ff; padding: 2px 6px; border-radius: 7px; color: #1e3a8a; }

.auth-shell {
  display: grid;
  place-items: center;
  min-height: min(680px, calc(100vh - 170px));
  padding: 18px 0 36px;
}
.auth-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.auth-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.brand-orb.small { width: 48px; height: 48px; border-radius: 16px; font-size: 24px; flex: 0 0 auto; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; padding: 6px; border-radius: 18px; background: #f1f5f9; }
.auth-tab { border: 0; border-radius: 14px; padding: 12px; background: transparent; color: var(--muted); font-weight: 950; cursor: pointer; }
.auth-tab.active { background: #ffffff; color: var(--cyan); box-shadow: 0 8px 18px rgba(15,23,42,.08); }
.auth-form { display: grid; gap: 13px; }
.button.google { color: #1f2937; background: #ffffff; border: 1px solid #dbe4f0; box-shadow: 0 8px 18px rgba(15,23,42,.06); }
.button.google::before { content: "G"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; color: #2563eb; background: #eff6ff; font-weight: 950; }
.auth-help { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.auth-message { border-radius: 16px; padding: 13px; font-weight: 800; line-height: 1.45; margin-top: 14px; }
.auth-message.error { color: var(--red); background: #fef2f2; border: 1px solid #fecaca; }
.auth-message.success { color: var(--green); background: #ecfdf5; border: 1px solid #bbf7d0; }
.user-pill { border: 1px solid #bfdbfe; border-radius: 999px; padding: 10px 14px; font-weight: 900; background: #eff6ff; color: #1d4ed8; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-home-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.user-home-card h2 { word-break: break-word; }

.panel { border-radius: var(--radius); padding: 22px; margin-bottom: 18px; position: relative; overflow: hidden; }
.panel::before { content:""; position:absolute; inset:0 0 auto; height: 4px; background: linear-gradient(90deg, #2563eb, #7c3aed, #06b6d4); }
.hero-panel { background: #ffffff; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-title.compact { margin-bottom: 14px; }
.soft-badge { color: #1d4ed8; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 999px; padding: 8px 12px; font-weight: 900; font-size: 12px; white-space: nowrap; }
.muted, .hint, small { color: var(--muted); }
.hint { font-size: 13px; margin: 8px 0 0; line-height: 1.45; }

.primary-cta {
  width: 100%; border-radius: 24px; margin: 2px 0 18px; padding: 18px;
  color: #ffffff; font-size: 21px; font-weight: 950; cursor: pointer; border: 0;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}
.primary-cta span { color: #bfdbfe; margin-right: 8px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.summary-grid.compact-grid { grid-template-columns: repeat(4, 1fr); }
.summary-card { border-radius: 20px; padding: 16px; min-height: 104px; display: grid; align-content: space-between; position: relative; overflow: hidden; }
.summary-card::after { content:""; position:absolute; width: 90px; height: 90px; border-radius: 50%; right: -34px; bottom: -40px; opacity: .10; background: currentColor; }
.summary-card span { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.summary-card strong { font-size: 26px; letter-spacing: -.03em; color: currentColor; }
.neon-cyan { color: var(--cyan); }
.neon-pink { color: var(--pink); }
.neon-green { color: var(--green); }
.neon-yellow { color: var(--yellow); }
.neon-red { color: var(--red); }

form, .quick-form { display: grid; gap: 14px; }
label { display: grid; gap: 8px; color: #344054; font-weight: 850; }
input, select, textarea {
  width: 100%; min-height: 48px; border: 1px solid #cfd8e6; border-radius: 14px; padding: 11px 13px;
  background: #ffffff; color: var(--text); outline: none; font: inherit; font-weight: 750;
}
input:focus, select:focus, textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.10); }
input[readonly], input:disabled { color: #475467; opacity: 1; background: #f8fafc; }
option, optgroup { color: #101426; }
.form-row { display: grid; gap: 14px; }
.form-row.triple { grid-template-columns: repeat(3, 1fr); }
.form-row.double, .form-row.two { grid-template-columns: repeat(2, 1fr); }
.form-row.compact-row { align-items: end; }
.form-row.four { grid-template-columns: 1.15fr 1fr .8fr .9fr; }
.input-with-button { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.mode-panel, .option-card {
  border: 1px solid #dbe4f0; border-radius: 18px; padding: 14px; background: #f8fafc;
}
.option-title { display: block; margin-bottom: 10px; font-weight: 950; color: #111827; }
.radio-row { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 7px; min-height: auto; color: #344054; }
.radio-row input { width: auto; min-height: auto; accent-color: var(--cyan); }

.bonus-coupon-status {
  min-height: 48px; border: 1px solid #dbe4f0; border-radius: 14px; padding: 11px 13px;
  background: #ffffff; display: grid; align-content: center; gap: 4px;
}
.bonus-coupon-status strong { color: var(--muted); font-size: 15px; }
.bonus-coupon-status span { color: var(--muted); font-size: 12px; font-weight: 750; line-height: 1.35; }
.option-card.bonus-active { border-color: rgba(14,165,233,.55); background: linear-gradient(180deg, #f0f9ff, #ffffff); }
.option-card.bonus-active .bonus-coupon-status strong { color: var(--cyan); }

.time-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.time-preview div, .member-preview, .stat-line {
  border: 1px solid #dbe4f0; border-radius: 16px; background: #f8fafc; padding: 13px;
}
.time-preview span, .member-preview span, .stat-line span { display:block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 900; margin-bottom: 5px; }
.time-preview strong, .member-preview strong, .stat-line strong { color: var(--cyan); font-size: 20px; }
.saved-time-box { display: grid; gap: 8px; align-content: start; }
.saved-time-box .mini-button { width: 100%; min-height: 34px; padding: 8px 10px; font-size: 12px; }
.saved-time-box small { color: var(--muted); font-weight: 750; line-height: 1.35; }

.button, .mini-button, .icon-button {
  border: 0; border-radius: 14px; padding: 12px 14px; font: inherit; font-weight: 900; cursor: pointer; color: #ffffff;
}
.button.primary { background: linear-gradient(135deg, #2563eb, #0ea5e9); box-shadow: 0 10px 24px rgba(37,99,235,.18); }
.button.secondary { background: linear-gradient(135deg, #7c3aed, #2563eb); }
.button.danger, .mini-button.danger { background: linear-gradient(135deg, #dc2626, #f97316); color: #ffffff; }
.button:disabled, .mini-button:disabled { opacity: .65; cursor: wait; }
.mini-button { min-height: 40px; background: #f1f5f9; color: #1f2937; border: 1px solid #dbe4f0; }
.mini-button.success { color: #ffffff; background: linear-gradient(135deg, #059669, #0ea5e9); border: 0; }
.mini-button.warn { color: #ffffff; background: linear-gradient(135deg, #d97706, #f59e0b); border: 0; }
.mini-button.whatsapp { display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; background: linear-gradient(135deg, #16a34a, #22c55e); color: #ffffff; border: 0; }
.whatsapp-detail-row { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icon-button { width: 42px; height: 42px; display:grid; place-items:center; border-radius: 50%; background: #f1f5f9; color: #111827; font-size: 26px; }

.tool-row { display: grid; grid-template-columns: 1fr 180px 220px; gap: 12px; }
.sticky-tools { position: sticky; top: 10px; z-index: 4; }
.customer-list, .session-list, .expense-list, .activity-list, .report-list { display: grid; gap: 12px; }
.card-item, .activity-item, .expense-item, .report-row {
  border: 1px solid #dbe4f0; border-radius: 18px; padding: 15px; background: #ffffff;
}
.card-item { display: grid; gap: 12px; }
.card-top, .session-head, .expense-head, .activity-head, .report-row { display:flex; align-items:flex-start; justify-content:space-between; gap: 12px; }
.customer-name, .session-name, .expense-title { font-size: 18px; font-weight: 950; color: #111827; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display:inline-flex; align-items:center; gap: 5px; padding: 6px 9px; border-radius: 999px; font-weight: 900; font-size: 12px; background: #f8fafc; border: 1px solid #dbe4f0; color: #475467; }
.badge.cyan { color: var(--cyan); border-color: #bfdbfe; background: #eff6ff; }
.badge.pink { color: var(--pink); border-color: #ddd6fe; background: #f5f3ff; }
.badge.green { color: var(--green); border-color: #bbf7d0; background: #ecfdf5; }
.badge.yellow { color: var(--yellow); border-color: #fed7aa; background: #fff7ed; }
.badge.red { color: var(--red); border-color: #fecaca; background: #fef2f2; }
.card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.card-actions, .session-actions, .expense-actions, .backup-actions { display:flex; flex-wrap: wrap; gap: 10px; }
.extension-control { display: grid; grid-template-columns: 110px 140px 170px 160px auto; gap: 10px; align-items: end; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #cfd8e6; }
.extension-control label { font-size: 12px; }
.extension-control input, .extension-control select { min-height: 40px; }

.activity-group { display: grid; gap: 10px; }
.group-title { margin: 14px 0 4px; color: var(--pink); font-size: 13px; text-transform: uppercase; letter-spacing: .14em; }
.activity-item { border-left: 4px solid var(--cyan); }
.activity-item.expense { border-left-color: var(--red); }
.activity-item.redeem { border-left-color: var(--pink); }
.activity-item.payment { border-left-color: var(--yellow); }
.activity-item.delete { border-left-color: #f97316; }

.detail-dialog { width: min(980px, calc(100% - 26px)); border: 1px solid #dbe4f0; border-radius: 24px; background: #ffffff; color: var(--text); box-shadow: var(--shadow); padding: 0; }
.detail-dialog::backdrop { background: rgba(15,23,42,.38); backdrop-filter: blur(4px); }
.dialog-head { display:flex; justify-content:space-between; gap: 12px; padding: 22px; border-bottom: 1px solid #e5e7eb; }
#dialogContent { padding: 22px; display: grid; gap: 14px; }
.detail-grid { display:grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.detail-grid .stat-line { background: #f8fafc; }
.proof-img { max-width: 100%; max-height: 520px; border-radius: 18px; border: 1px solid #dbe4f0; }

.two-col-report { display:grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.report-row { align-items:center; }
.report-row span { color: var(--muted); }
.report-row strong { font-size: 18px; }
.empty-state, .loading-state { border: 1px dashed #cbd5e1; border-radius: 18px; padding: 18px; color: var(--muted); text-align: center; background: #ffffff; }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; transition: .22s ease; z-index: 20; background: #111827; color:#fff; border:1px solid rgba(37,99,235,.28); border-radius: 999px; padding: 12px 16px; box-shadow: var(--shadow); max-width: min(680px, calc(100% - 30px)); text-align:center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.bottom-nav { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: min(820px, calc(100% - 24px)); padding: 8px; border-radius: 24px; background: rgba(255,255,255,.94); border: 1px solid #dbe4f0; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.nav-item { border:0; border-radius: 17px; padding: 9px 6px; background: transparent; color: var(--muted); font-weight: 900; cursor:pointer; display:grid; gap: 3px; place-items:center; }
.nav-item.active { background: linear-gradient(135deg, #2563eb, #7c3aed); color: #ffffff; }
.nav-item span { font-size: 11px; }

.activity-filter-row { display: grid; grid-template-columns: minmax(180px, 260px); gap: 10px; margin: 12px 0; }
.scrollable-activity { max-height: 430px; overflow-y: auto; padding-right: 6px; }
.scrollable-sessions { max-height: 620px; overflow-y: auto; padding-right: 6px; }
.scrollable-activity::-webkit-scrollbar, .scrollable-sessions::-webkit-scrollbar { width: 8px; }
.scrollable-activity::-webkit-scrollbar-thumb, .scrollable-sessions::-webkit-scrollbar-thumb { background: #bfdbfe; border-radius: 999px; }

@media (max-width: 980px) {
  .app-header { display:grid; }
  .header-tools { justify-items:start; min-width: 0; grid-template-columns: 1fr 1fr; width: 100%; }
  .summary-grid, .summary-grid.compact-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row.triple, .form-row.double, .form-row.two, .form-row.four, .time-preview, .detail-grid, .two-col-report { grid-template-columns: 1fr; }
  .tool-row { grid-template-columns: 1fr; }
  .extension-control { grid-template-columns: 1fr 1fr; }
  .card-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .auth-card { padding: 18px; border-radius: 24px; }
  .user-home-card { display: grid; }
  body { padding-bottom: 96px; }
  .app-shell { width: min(100% - 18px, 1180px); padding-top: 18px; }
  .brand-wrap { align-items:flex-start; }
  .brand-orb { width: 52px; height:52px; border-radius: 18px; font-size: 25px; }
  h1 { font-size: 34px; }
  .subhead { font-size: 14px; }
  .panel { padding: 16px; border-radius: 20px; }
  .summary-card { min-height: 96px; padding: 14px; }
  .summary-card strong { font-size: 22px; }
  .section-title { align-items:flex-start; flex-direction: column; }
  .header-tools { grid-template-columns: 1fr; }
  .extension-control { grid-template-columns: 1fr; }
  .card-stats { grid-template-columns: 1fr; }
  .bottom-nav { bottom: 10px; width: calc(100% - 16px); border-radius: 20px; }
  .nav-item { padding: 8px 2px; font-size: 14px; }
  .nav-item span { font-size: 10px; }
}

.online-user-list { display: grid; gap: 10px; max-height: 270px; overflow-y: auto; padding-right: 6px; }
.online-user-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border: 1px solid #dbe4f0; border-radius: 18px; padding: 13px 14px; background: #ffffff; }
.online-user-item.online { border-color: #bbf7d0; background: #f8fffb; }
.online-user-item.offline { border-color: #fecaca; background: #fffafa; }
.status-dot { width: 12px; height: 12px; border-radius: 999px; box-shadow: 0 0 0 4px rgba(148,163,184,.12); }
.status-dot.online { background: #16a34a; box-shadow: 0 0 0 4px rgba(34,197,94,.16); }
.status-dot.offline { background: #dc2626; box-shadow: 0 0 0 4px rgba(239,68,68,.14); }
.online-user-state { display: grid; justify-items: end; gap: 2px; font-size: 12px; white-space: nowrap; }
.online-user-state strong { font-size: 13px; color: #111827; }
.online-user-state span { color: var(--muted); }
.online-user-list::-webkit-scrollbar { width: 8px; }
.online-user-list::-webkit-scrollbar-thumb { background: #bfdbfe; border-radius: 999px; }

@media (max-width: 560px) {
  .online-user-item { grid-template-columns: auto 1fr; align-items: start; }
  .online-user-state { grid-column: 2; justify-items: start; }
}

.game-list { display: grid; gap: 12px; }
.game-item { border: 1px solid #dbe4f0; border-radius: 18px; padding: 15px; background: #ffffff; display: grid; gap: 12px; }
.game-head { display:flex; align-items:flex-start; justify-content:space-between; gap: 12px; }
.game-title { font-size: 18px; font-weight: 950; color: #111827; }
.game-price { color: var(--green); font-size: 18px; font-weight: 950; white-space: nowrap; }
.game-actions { display:flex; flex-wrap: wrap; gap: 10px; }
.button-row { display:flex; flex-wrap: wrap; gap: 10px; align-items:center; }
.button-row.compact-buttons { justify-content:flex-end; }
.bottom-nav { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 560px) {
  .bottom-nav { gap: 4px; }
  .nav-item span { font-size: 9px; }
  .game-head { display:grid; }
  .game-price { white-space: normal; }
}

/* v12 Order Isi Game */
.order-list { display: grid; gap: 12px; }
.order-item { border: 1px solid #dbe4f0; border-radius: 18px; padding: 15px; background: #ffffff; display: grid; gap: 12px; }
.order-head { display:flex; align-items:flex-start; justify-content:space-between; gap: 12px; }
.order-title { font-size: 18px; font-weight: 950; color: #111827; }
.order-games-preview { border: 1px solid #dbe4f0; background: #f8fafc; border-radius: 14px; padding: 12px; color: #344054; line-height: 1.45; }
.order-actions { display:flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.order-update-control { display: grid; grid-template-columns: minmax(150px, 210px) auto; gap: 8px; align-items: center; }
.order-update-control select { min-height: 40px; padding: 8px 10px; }
.order-tool-row { grid-template-columns: 1fr 180px 180px 170px; margin-bottom: 12px; }
.order-actions-row { margin: 0 0 12px; justify-content: flex-start; }
.scrollable-orders { max-height: 680px; overflow-y: auto; padding-right: 6px; }
.scrollable-orders::-webkit-scrollbar { width: 8px; }
.scrollable-orders::-webkit-scrollbar-thumb { background: #bfdbfe; border-radius: 999px; }
.order-items-detail { display:grid; gap: 10px; margin-bottom: 14px; }
.order-detail-item { display:flex; align-items:flex-start; justify-content:space-between; gap: 12px; border:1px solid #dbe4f0; border-radius: 15px; background:#f8fafc; padding: 12px; }
.order-detail-item span { display:block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.detail-order-actions { display:flex; flex-wrap:wrap; gap: 10px; align-items: end; margin-top: 14px; }
.detail-order-actions label { min-width: min(100%, 220px); }
.bottom-nav { grid-template-columns: repeat(7, 1fr); }

@media (max-width: 980px) {
  .order-tool-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .order-head, .order-detail-item { display:grid; }
  .order-update-control { grid-template-columns: 1fr; width: 100%; }
  .order-actions .mini-button, .order-actions .order-update-control { width: 100%; }
}

/* v13 Gudang Game */
.game-price-stack { display: grid; justify-items: end; gap: 3px; min-width: 145px; }
.game-price-stack span { color: var(--muted); font-size: 12px; font-weight: 800; text-align: right; }
.soft-disabled { opacity: .72; }
.soft-disabled input { background: #f8fafc; }
.quick-form textarea { width: 100%; resize: vertical; min-height: 110px; }
@media (max-width: 560px) {
  .game-price-stack { justify-items: start; min-width: 0; }
  .game-price-stack span { text-align: left; }
}

/* Realtime order notification */
.badge-row.tight { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.badge.warning { background: rgba(217,119,6,.12); color: var(--yellow); border: 1px solid rgba(217,119,6,.22); }
.badge.green { background: rgba(5,150,105,.12); color: var(--green); border: 1px solid rgba(5,150,105,.22); }
.order-notification-banner {
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  border: 1px solid rgba(37,99,235,.24);
  background: linear-gradient(135deg, rgba(37,99,235,.10), rgba(124,58,237,.08)), #fff;
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.order-notification-banner.hidden { display:none; }
.order-notification-banner strong { color: var(--cyan); display:block; margin-bottom:4px; }
.order-notification-banner p { margin:0; color: var(--muted); }
.order-notification-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.nav-item { position: relative; }
.nav-badge {
  position:absolute; top:5px; right:9px; min-width:18px; height:18px; padding:0 5px;
  display:inline-grid; place-items:center; border-radius:999px; background: var(--red); color:#fff;
  font-size:10px; font-weight:800; line-height:1; box-shadow: 0 6px 14px rgba(220,38,38,.26);
}
.nav-badge.hidden { display:none; }
@media (max-width: 720px) {
  .order-notification-banner { align-items:flex-start; flex-direction:column; }
  .order-notification-actions { width:100%; justify-content:space-between; }
  #btnEnableNotifications { padding: 8px 10px; font-size: 12px; }
}

/* v15 - Join kupon */
.join-coupon-box { display: grid; gap: 14px; }
.join-coupon-list { display: grid; gap: 10px; max-height: min(52vh, 520px); overflow: auto; padding-right: 4px; }
.join-coupon-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 12px; border: 1px solid rgba(99, 102, 241, .18); border-radius: 16px; background: rgba(255, 255, 255, .72); }
.join-coupon-row.highlight { border-color: rgba(79, 70, 229, .48); background: linear-gradient(135deg, rgba(79, 70, 229, .10), rgba(6, 182, 212, .08)); }
.join-coupon-info { display: grid; gap: 3px; min-width: 0; }
.join-coupon-info span { color: var(--muted); font-size: .88rem; }
.join-coupon-note { display: inline-flex; gap: 4px; align-items: center; font-weight: 700; color: var(--text) !important; }
.join-coupon-row.is-used { border-color: rgba(22, 163, 74, .35); background: linear-gradient(135deg, rgba(22, 163, 74, .08), rgba(255, 255, 255, .78)); }
.join-coupon-row.is-extra { opacity: .68; }
.stat-line strong.good { color: var(--green); }
.stat-line strong.bad { color: var(--red); }
.empty-state.subtle { background: rgba(79, 70, 229, .06); border-style: dashed; }
@media (max-width: 620px) {
  .join-coupon-row { grid-template-columns: auto 1fr; }
}

/* v19 - Status PS dan booking member */
.ps-status-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ps-status-card {
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(248,250,252,.92));
  box-shadow: 0 12px 28px rgba(15,23,42,.06);
  display:grid;
  gap: 10px;
}
.ps-status-card.busy { border-color: rgba(220,38,38,.28); background: linear-gradient(135deg, rgba(254,242,242,.96), rgba(255,255,255,.92)); }
.ps-status-card.available { border-color: rgba(5,150,105,.28); background: linear-gradient(135deg, rgba(236,253,245,.96), rgba(255,255,255,.92)); }
.ps-status-card.maintenance { border-color: rgba(245,158,11,.34); background: linear-gradient(135deg, rgba(255,251,235,.96), rgba(255,255,255,.92)); }
.ps-status-head { display:flex; align-items:center; gap: 9px; font-size: 16px; }
.ps-dot { width: 12px; height: 12px; border-radius:999px; display:inline-block; box-shadow:0 0 0 5px rgba(148,163,184,.14); }
.ps-dot.red { background: var(--red); box-shadow:0 0 0 5px rgba(220,38,38,.12); }
.ps-dot.green { background: var(--green); box-shadow:0 0 0 5px rgba(5,150,105,.12); }
.ps-dot.orange { background: #f59e0b; box-shadow:0 0 0 5px rgba(245,158,11,.16); }
.ps-status-body { display:grid; gap: 3px; color: var(--muted); }
.ps-status-body strong { color: var(--text); font-size: 18px; }
.ps-status-body small { color: var(--muted); font-weight: 700; }
.ps-status-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding-top:4px; }
.mini-button.warning { color:#92400e; background:#fffbeb; border-color:rgba(245,158,11,.34); }
.booking-list { display:grid; gap: 10px; }
.booking-item { display:flex; justify-content:space-between; align-items:center; gap:12px; border:1px solid rgba(148,163,184,.22); background:#fff; border-radius:16px; padding:12px; }
.booking-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:8px; }
.mini-button:disabled, button:disabled { opacity:.48; cursor:not-allowed; filter: grayscale(.2); }
@media (max-width: 760px) {
  .ps-status-grid { grid-template-columns: 1fr; }
  .booking-item { align-items:flex-start; flex-direction:column; }
  .booking-actions { width:100%; justify-content:flex-start; }
}

/* v20 - gaming banner, side drawer, dynamic PS, chat admin, game request */
.app-header {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37,99,235,.18);
  border-radius: 30px;
  padding: 22px;
  background:
    radial-gradient(circle at 8% 18%, rgba(96,165,250,.34), transparent 28%),
    radial-gradient(circle at 86% 6%, rgba(168,85,247,.32), transparent 30%),
    linear-gradient(135deg, #08111f 0%, #172554 48%, #3b1764 100%);
  color: #fff;
  box-shadow: 0 24px 64px rgba(15,23,42,.22);
}
.app-header::after {
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 86%);
}
.app-header .brand-wrap,
.app-header .header-tools { position: relative; z-index: 1; }
.app-header h1,
.app-header .subhead { color:#fff; }
.app-header .eyebrow { color:#93c5fd; }
.app-header .brand-orb { background: linear-gradient(135deg, #2563eb, #7c3aed, #06b6d4); }
.app-header .clock-card,
.app-header .status-pill,
.app-header .user-pill { background: rgba(255,255,255,.92); }
.input-with-button.ps-unit-input { display:flex; align-items:stretch; gap:8px; }
.ps-unit-input select { flex:1; min-width:0; }
.ps-delete-button { min-width: 46px; }
.plus-button {
  min-width: 46px;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border: 0;
}
.bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  max-width: 760px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 20px));
}
.bottom-nav .drawer-toggle { color: var(--pink); }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 69;
  background: rgba(15,23,42,.36);
  backdrop-filter: blur(3px);
}
.side-drawer {
  position: fixed;
  right: 14px;
  bottom: 94px;
  z-index: 70;
  width: min(340px, calc(100vw - 28px));
  border: 1px solid rgba(37,99,235,.22);
  border-radius: 26px;
  padding: 16px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 28px 70px rgba(15,23,42,.24);
  display: grid;
  gap: 10px;
}
.drawer-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom: 4px; }
.drawer-head h2 { font-size: 22px; }
.drawer-item {
  width:100%;
  display:flex;
  align-items:center;
  gap:12px;
  justify-content:flex-start;
  border:1px solid rgba(148,163,184,.20);
  border-radius:18px;
  padding:14px;
  color:#172554;
  background: linear-gradient(135deg, rgba(239,246,255,.95), rgba(255,255,255,.96));
  font-weight:950;
  cursor:pointer;
}
.drawer-item span { font-weight:950; }
.drawer-item.active { background: linear-gradient(135deg, #2563eb, #7c3aed); color:#fff; }

.chat-title-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:flex-end; }
.chat-title-actions .mini-button { min-height: 36px; }
.chat-admin-panel { min-height: 320px; }
.admin-chat-layout {
  display:grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 14px;
  align-items: stretch;
}
.admin-chat-thread-list,
.admin-chat-messages {
  border:1px solid rgba(148,163,184,.22);
  border-radius: 18px;
  background: #f8fafc;
  overflow:auto;
}
.admin-chat-thread-list { max-height: 360px; padding: 10px; display:grid; gap:9px; }
.admin-chat-thread {
  border:1px solid rgba(148,163,184,.22);
  border-radius:16px;
  padding:12px;
  background:#fff;
  cursor:pointer;
  display:grid;
  gap:4px;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}
.admin-chat-thread.active { border-color: rgba(37,99,235,.42); background: linear-gradient(135deg, rgba(239,246,255,.96), #fff); }
.admin-chat-thread strong { color:#0f172a; }
.admin-chat-thread small { color:#64748b; }
.admin-chat-box { display:grid; grid-template-rows: 1fr auto; gap:10px; min-height: 360px; }
.admin-chat-messages { padding: 12px; display:grid; align-content:start; gap:9px; max-height: 360px; }
.chat-message {
  width: fit-content;
  max-width: 78%;
  border:1px solid rgba(148,163,184,.22);
  border-radius: 18px;
  padding: 10px 12px;
  background:#fff;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}
.chat-message.admin {
  justify-self:end;
  color:#fff;
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}
.chat-message p { margin:4px 0; line-height:1.42; }
.chat-message.admin small,
.chat-message.admin strong { color:#fff; }
.admin-chat-form { display:flex; gap:8px; }
.admin-chat-form input { flex:1; min-width:0; }
.game-request-list { display:grid; gap:10px; }
.game-request-card {
  border:1px solid rgba(148,163,184,.22);
  border-radius:18px;
  padding:14px;
  background:#fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
  display:grid;
  gap:10px;
}
.game-request-card.pending { border-color: rgba(217,119,6,.28); background: linear-gradient(135deg, rgba(255,251,235,.96), #fff); }
.game-request-card.ditambahkan { border-color: rgba(5,150,105,.28); background: linear-gradient(135deg, rgba(236,253,245,.96), #fff); }
.game-request-card.ditolak { border-color: rgba(220,38,38,.28); background: linear-gradient(135deg, rgba(254,242,242,.96), #fff); }
.game-request-head,
.game-request-actions { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.game-request-actions { justify-content:flex-start; }
.game-request-meta { color:#64748b; display:flex; flex-wrap:wrap; gap:8px; font-size:13px; }
.badge.request { background:#eef2ff; color:#4338ca; border:1px solid #c7d2fe; }
.badge.request.pending { background:#fffbeb; color:#92400e; border-color:#fed7aa; }
.badge.request.dicek { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; }
.badge.request.ditambahkan { background:#ecfdf5; color:#047857; border-color:#bbf7d0; }
.badge.request.ditolak { background:#fef2f2; color:#b91c1c; border-color:#fecaca; }
.customer-booking-history { margin-bottom: 18px; }
.customer-booking-history .booking-item { align-items:flex-start; }
@media (max-width: 820px) {
  .app-header { flex-direction: column; }
  .header-tools { width:100%; justify-items:start; }
  .admin-chat-layout { grid-template-columns: 1fr; }
  .admin-chat-box { min-height: 300px; }
  .bottom-nav { width: calc(100% - 14px); }
  .bottom-nav .nav-item { font-size: 11px; }
  .side-drawer { left: 10px; right: 10px; width:auto; }
}

/* v20 aliases for rendered class names */
.chat-thread {
  border:1px solid rgba(148,163,184,.22);
  border-radius:16px;
  padding:12px;
  background:#fff;
  cursor:pointer;
  display:grid;
  gap:4px;
  text-align:left;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}
.chat-thread.active { border-color: rgba(37,99,235,.42); background: linear-gradient(135deg, rgba(239,246,255,.96), #fff); }
.chat-thread strong { color:#0f172a; }
.chat-thread span,
.chat-thread small { color:#64748b; }
.chat-bubble {
  width: fit-content;
  max-width: 78%;
  border:1px solid rgba(148,163,184,.22);
  border-radius: 18px;
  padding: 10px 12px;
  background:#fff;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}
.chat-bubble.admin {
  justify-self:end;
  color:#fff;
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}
.chat-bubble p { margin:4px 0; line-height:1.42; }
.chat-bubble.admin small,
.chat-bubble.admin strong { color:#fff; }
.chat-active-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  background:#eef2ff;
  color:#1e3a8a;
}
.chat-active-head > div { display:grid; gap:2px; }
.game-request-item {
  border:1px solid rgba(148,163,184,.22);
  border-radius:18px;
  padding:14px;
  background:#fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
  display:grid;
  gap:10px;
}
.game-request-item.request-menunggu { border-color: rgba(217,119,6,.28); background: linear-gradient(135deg, rgba(255,251,235,.96), #fff); }
.game-request-item.request-dicek { border-color: rgba(37,99,235,.28); background: linear-gradient(135deg, rgba(239,246,255,.96), #fff); }
.game-request-item.request-ditambahkan { border-color: rgba(5,150,105,.28); background: linear-gradient(135deg, rgba(236,253,245,.96), #fff); }
.game-request-item.request-ditolak { border-color: rgba(220,38,38,.28); background: linear-gradient(135deg, rgba(254,242,242,.96), #fff); }

/* v20.5 - chat popup, chat/request notifications */
.admin-chat-fab {
  position: fixed;
  right: 18px;
  bottom: 98px;
  z-index: 68;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 13px 17px;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, #2563eb, #7c3aed, #06b6d4);
  box-shadow: 0 20px 42px rgba(37,99,235,.32);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.admin-chat-fab.is-dragging { cursor: grabbing; animation: none !important; transition: none !important; }
.admin-chat-fab.is-moved { right: auto !important; bottom: auto !important; }
.admin-chat-fab.has-unread {
  animation: kreffiaRing 1.15s ease-in-out infinite;
}
.admin-chat-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #dc2626;
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 8px 16px rgba(220,38,38,.32);
}
@keyframes kreffiaRing {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 20px 42px rgba(37,99,235,.32); }
  45% { transform: translateY(-2px) scale(1.035); box-shadow: 0 24px 52px rgba(124,58,237,.42); }
}
.admin-chat-popup {
  position: fixed;
  right: 16px;
  bottom: 154px;
  z-index: 76;
  width: min(820px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 180px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid rgba(37,99,235,.24);
  border-radius: 26px;
  overflow: hidden;
  background: rgba(255,255,255,.98);
  box-shadow: 0 30px 80px rgba(15,23,42,.28);
  opacity: 0;
  transform: translateY(22px) scale(.985);
  transition: opacity .18s ease, transform .18s ease;
}
.admin-chat-popup.open { opacity: 1; transform: translateY(0) scale(1); }
.admin-chat-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #2563eb, #7c3aed);
}
.admin-chat-popup-head h2,
.admin-chat-popup-head .eyebrow { color:#fff; }
.admin-chat-popup-tools {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148,163,184,.18);
  background: #f8fbff;
}
.admin-chat-popup .admin-chat-layout {
  min-height: 0;
  max-height: min(540px, calc(100vh - 296px));
  padding: 12px;
  overflow: hidden;
}
.admin-chat-popup .admin-chat-thread-list,
.admin-chat-popup .admin-chat-messages {
  max-height: min(500px, calc(100vh - 324px));
  min-height: 260px;
}
.admin-chat-popup .admin-chat-box { min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
.notification-popup {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 82;
  width: min(430px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(37,99,235,.24);
  border-radius: 20px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 60px rgba(15,23,42,.22);
}
.notification-popup.request-popup { top: 108px; }
.notification-popup.booking-popup { top: 198px; }
.notification-popup strong { display:block; color:#172554; margin-bottom: 3px; }
.notification-popup p { margin:0; color:#64748b; font-weight: 750; line-height: 1.35; }
.notification-popup-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.ghost-danger { background:#fff1f2 !important; color:#b91c1c !important; border:1px solid #fecaca !important; }
@media (max-width: 820px) {
  .admin-chat-fab { right: 12px; bottom: 88px; }
  .admin-chat-popup {
    left: 10px;
    right: 10px;
    bottom: 138px;
    width: auto;
    max-height: calc(100vh - 152px);
  }
  .admin-chat-popup .admin-chat-layout {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 270px);
    overflow: auto;
  }
  .admin-chat-popup .admin-chat-thread-list,
  .admin-chat-popup .admin-chat-messages {
    max-height: 240px;
    min-height: 160px;
  }
  .notification-popup,
  .notification-popup.request-popup {
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
  }
  .notification-popup.request-popup { top: 106px; }
  .notification-popup.booking-popup { top: 202px; }
}

/* v21 - role access, mobile dashboard, chat unread, compact customer */
body.role-admin .drawer-toggle,
body.role-admin #sideDrawer,
body.role-admin #drawerBackdrop,
body.role-admin #btnOpenSideDrawer,
body.role-admin #btnAddPsUnit,
body.role-admin #btnDeleteSelectedPsUnit,
body.role-admin #btnOpenBroadcast { display: none !important; }
body.role-admin #pricePerHour { pointer-events:none; opacity:.76; }
.icon-logout { min-width: 42px; padding-inline: 10px; font-size: 18px; }
.app-header { align-items: center; gap: 16px; }
.app-header .brand-wrap { flex: 1 1 360px; min-width: 0; }
.app-header .header-tools { flex: 0 1 520px; justify-content: flex-end; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.app-header .header-tools > * { white-space: nowrap; }
.chat-thread { position: relative; }
.chat-thread-top { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; }
.thread-unread-badge { min-width: 22px; height:22px; padding:0 7px; border-radius:999px; display:inline-grid; place-items:center; color:#fff; background:#dc2626; font-size:11px; box-shadow:0 8px 18px rgba(220,38,38,.28); }
.chat-thread.has-unread { border-color: rgba(220,38,38,.34); background: rgba(254,242,242,.92); }
.compact-customer-card .customer-main-line { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.compact-customer-card .customer-actions { justify-content:flex-end; margin-top:10px; }
.broadcast-member-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px; border:1px solid rgba(148,163,184,.22); border-radius:16px; background:#fff; margin-top:8px; }
.broadcast-member-row div { display:grid; gap:2px; }
.broadcast-member-row span { color:#64748b; font-size:12px; }
.booking-note-inline { display:block; margin-top:4px; color:#92400e !important; font-weight:800; }
.start-time-box { display:grid; gap:6px; }
.manual-time-toggle { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:800; color:#475569; }
.manual-time-input { max-width: 130px; }

@media (max-width: 720px) {
  body { font-size: 14px; }
  .app-shell { padding: 10px 10px 96px; }
  .app-header { border-radius: 22px; padding: 14px; align-items:flex-start; }
  .app-header .brand-wrap { width:100%; flex-basis:100%; }
  .app-header .brand-wrap h1 { font-size: 20px; line-height:1.05; }
  .app-header .brand-wrap .subhead { display:none; }
  .app-header .header-tools { width:100%; flex-basis:100%; justify-content:space-between; gap:6px; }
  .clock-card, .status-pill, .user-pill { font-size: 11px; padding: 7px 9px; }
  .user-pill { max-width: 120px; overflow:hidden; text-overflow:ellipsis; }
  .mini-button, .button { min-height: 38px; border-radius: 13px; }
  .main-content { gap: 10px; }
  .panel { padding: 12px; border-radius: 20px; margin-bottom: 10px; }
  .section-head { gap: 8px; margin-bottom: 10px; }
  .section-head h2 { font-size: 18px; }
  .primary-cta { width: 100%; min-height: 48px; border-radius: 18px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-card { padding: 10px; border-radius: 16px; }
  .stat-card strong { font-size: 18px; }
  .ps-status-grid, .info-grid, .summary-grid, .detail-grid, .member-stat-grid { grid-template-columns: 1fr; gap: 8px; }
  .ps-status-card, .booking-item, .card-item, .customer-item, .order-item, .game-item { border-radius: 17px; padding: 11px; }
  .session-head, .order-head, .game-head, .booking-item { align-items:flex-start; }
  .session-actions, .booking-actions, .order-actions, .game-actions, .card-actions, .ps-status-actions { display:flex; flex-wrap:wrap; gap:7px; }
  .extension-control { grid-template-columns: repeat(2, minmax(0, 1fr)); gap:8px; }
  .extension-control button { grid-column: 1 / -1; }
  .bottom-nav { width: calc(100% - 14px); left:7px; right:7px; bottom:7px; border-radius: 20px; padding:6px; gap:5px; }
  .nav-item { min-height:52px; font-size:10px; border-radius:16px; }
  .nav-item span { font-size:10px; }
  .admin-chat-widget { left: 8px; right: 8px; bottom: 76px; width: auto; max-height: calc(100vh - 92px); border-radius: 22px; }
  .admin-chat-layout { grid-template-columns: 1fr; max-height: calc(100vh - 190px); }
  .admin-chat-thread-list { max-height: 148px; overflow:auto; display:grid; grid-auto-flow:column; grid-auto-columns:minmax(190px, 72%); }
  .admin-chat-messages { max-height: 46vh; overflow:auto; }
  .floating-admin-chat { bottom: 74px; right: 12px; }
  .customer-list { display:grid; gap:8px; }
  .compact-customer-card .customer-main-line { align-items:flex-start; }
}
@media (max-width: 720px) {
  .admin-chat-popup { left: 8px !important; right: 8px !important; bottom: 76px !important; width: auto !important; max-height: calc(100vh - 92px) !important; border-radius: 22px; }
  .admin-chat-fab { bottom: 74px !important; right: 12px !important; }
}

/* v21.4 - movable chat floating button */
.admin-chat-fab.is-moved { right: auto !important; bottom: auto !important; }
.admin-chat-fab.is-dragging, .admin-chat-fab.is-dragging.has-unread { animation: none !important; }

/* v21.7 - mobile responsive bottom menu & compact kasir home */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .app-shell {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 10px calc(108px + env(safe-area-inset-bottom)) !important;
    margin: 0 !important;
  }

  .bottom-nav {
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 6px !important;
    border-radius: 20px !important;
    overflow: hidden;
  }

  body.role-admin .bottom-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .bottom-nav .nav-item {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 54px !important;
    padding: 7px 1px 6px !important;
    border-radius: 16px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    white-space: nowrap;
    overflow: hidden;
  }

  .bottom-nav .nav-item span {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 9.5px !important;
    line-height: 1.05;
    letter-spacing: -.03em;
  }

  .bottom-nav .nav-badge {
    top: 4px;
    right: calc(50% - 22px);
    min-width: 17px;
    height: 17px;
    font-size: 9px;
    padding: 0 5px;
  }

  .admin-chat-fab:not(.is-moved) {
    right: 12px !important;
    bottom: calc(86px + env(safe-area-inset-bottom)) !important;
  }

  .admin-chat-popup {
    left: 8px !important;
    right: 8px !important;
    bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-height: calc(100vh - 96px - env(safe-area-inset-bottom)) !important;
  }

  .ps-status-card {
    padding: 11px !important;
    gap: 8px !important;
    border-radius: 17px !important;
  }

  .ps-status-head {
    font-size: 15px;
  }

  .ps-status-body strong {
    font-size: 17px;
    line-height: 1.15;
  }

  .ps-status-body small {
    font-size: 12px;
    line-height: 1.25;
  }

  .ps-status-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px !important;
    align-items: stretch !important;
  }

  .ps-status-actions .mini-button {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 7px;
    font-size: 12px;
    border-radius: 14px;
  }

  .ps-status-actions .mini-button.danger,
  .ps-status-actions .ghost-danger {
    grid-column: 1 / -1;
  }

  .header-tools {
    min-width: 0 !important;
  }

  .app-header .header-tools > * {
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .bottom-nav .nav-item span {
    font-size: 8.8px !important;
  }
  .bottom-nav .nav-item {
    font-size: 17px !important;
    min-height: 52px !important;
  }
}
