/* ============================================================
   GM Chat Support – app.css
   Messenger-style layout
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sky-500:    #0ea5e9;
  --sky-600:    #0284c7;
  --sky-700:    #0369a1;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-300:   #d1d5db;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-600:   #4b5563;
  --gray-700:   #374151;
  --gray-800:   #1f2937;
  --gray-900:   #111827;
  --red-500:    #ef4444;
  --red-600:    #dc2626;
  --green-400:  #4ade80;
  --green-500:  #22c55e;
  --sidebar-w:  320px;
  --header-h:   60px;
  --radius:     10px;
  --radius-sm:  6px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.12);
  --transition: 150ms ease;
}

/* ── Prevent iOS auto-zoom on input focus ────────────────── */
input, textarea, select {
  font-size: 16px !important;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-100);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Utilities ────────────────────────────────────────────── */
.d-none { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-weight: 500;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  { background: var(--sky-500); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--sky-600); }
.btn-ghost    { background: transparent; color: var(--gray-600); }
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-800); }
.btn-danger   { background: var(--red-500); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--red-600); }
.btn-sm       { padding: 5px 12px; font-size: 13px; }
.btn-full     { width: 100%; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-800);
  background: #fff;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus { border-color: var(--sky-500); box-shadow: 0 0 0 3px rgba(14,165,233,.12); }
.form-control:disabled { background: var(--gray-100); color: var(--gray-400); cursor: not-allowed; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: var(--red-600); }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-active { background: #dcfce7; color: #16a34a; }
.badge-draft  { background: #fef9c3; color: #854d0e; }
.badge-closed { background: var(--gray-100); color: var(--gray-500); }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner, .spinner-large {
  display: inline-block;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner       { width: 16px; height: 16px; }
.spinner-large { width: 36px; height: 36px; border-color: var(--gray-200); border-top-color: var(--sky-500); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading Screen ───────────────────────────────────────── */
.loading-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
  flex-direction: column;
  gap: 16px;
  color: var(--gray-500);
}

/* ── Login Page ───────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 50%, #f8fafc 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 36px 32px;
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
  font-size: 17px; font-weight: 700; color: var(--gray-800);
}
.login-card h2 {
  font-size: 20px; font-weight: 700; color: var(--gray-900);
  margin-bottom: 20px;
}

/* ── App Shell ────────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--gray-100);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100%;
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; color: var(--gray-900);
}
.sidebar-agent {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--gray-500);
}
.agent-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-400);
  flex-shrink: 0;
}

.sidebar-actions {
  display: flex; gap: 8px; padding: 10px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.search-bar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.search-bar .form-control {
  background: var(--gray-50);
  border-color: var(--gray-100);
  font-size: 13px;
}

.session-list {
  flex: 1; overflow-y: auto;
}

.session-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-50);
  transition: background var(--transition);
  position: relative;
}
.session-item:hover    { background: var(--gray-50); }
.session-item.active   { background: #f0f9ff; border-right: 2px solid var(--sky-500); }
.session-item.closed   { opacity: .65; }

.session-item-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-500), var(--sky-700));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.session-item-body { flex: 1; min-width: 0; }
.session-item-top  { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.session-item-name { font-weight: 600; font-size: 13px; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-item-time { font-size: 11px; color: var(--gray-400); white-space: nowrap; flex-shrink: 0; }
.session-item-bottom { margin-top: 2px; }
.session-item-assigned { font-size: 12px; color: var(--gray-400); }
.session-time { font-size: 11px; color: var(--gray-400); }
.session-item-meta { font-size: 11px; color: var(--gray-400); }

.unread-badge {
  min-width: 20px; height: 20px;
  background: var(--sky-500); color: #fff;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
  line-height: 1.8;
}

/* ── Chat Main ────────────────────────────────────────────── */
.chat-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  height: 100%;
  background: var(--gray-50);
}

.chat-empty {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--gray-400);
  gap: 12px;
  text-align: center;
  padding: 40px;
}
.chat-empty-icon { font-size: 48px; }
.chat-empty h3   { font-size: 18px; font-weight: 600; color: var(--gray-600); }
.chat-empty p    { font-size: 14px; }

/* ── Chat Panel ───────────────────────────────────────────── */
.chat-panel {
  display: flex; flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.chat-panel-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-500), var(--sky-700));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.chat-identity-info { min-width: 0; }
.chat-customer-name { font-weight: 700; font-size: 15px; color: var(--gray-900); }
.chat-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--gray-500); margin-top: 2px;
}
.chat-meta-sep { color: var(--gray-300); }
.chat-meta-fb-link { color: #0ea5e9; text-decoration: none; }
.chat-meta-fb-link:hover { text-decoration: underline; }
.chat-panel-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Message List ─────────────────────────────────────────── */
.message-list {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 20px 20px 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.messages-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--gray-400); font-size: 13px; text-align: center; gap: 8px;
}
.messages-empty-icon { font-size: 36px; }

/* ── Message Bubbles ──────────────────────────────────────── */
.message-row {
  display: flex; align-items: flex-end; gap: 8px;
  max-width: 72%;
}
.message-row.mine    { align-self: flex-end; flex-direction: row-reverse; }
.message-row.theirs  { align-self: flex-start; }

.bubble-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gray-300); color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

.bubble {
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 100%;
  min-width: 0;
  word-break: break-word;
  overflow: hidden;
  position: relative;
}
.bubble-agent {
  background: var(--sky-500); color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble-customer {
  background: #fff; color: var(--gray-800);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}
.bubble-sender {
  font-size: 11px; font-weight: 600; margin-bottom: 3px; opacity: .65;
}
.bubble-content { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.bubble-footer  {
  display: flex; align-items: center; gap: 4px; justify-content: flex-end;
  margin-top: 4px;
}
.bubble-time    { font-size: 10px; opacity: .7; }
.bubble-read-indicator { display: flex; align-items: center; }

/* ── Message Input Area ───────────────────────────────────── */
.message-input-area {
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.message-input-row {
  display: flex; align-items: flex-end; gap: 10px;
}
.message-textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 22px;
  font-size: 16px;
  font-family: inherit;
  resize: none;
  outline: none;
  background: var(--gray-50);
  max-height: 120px;
  overflow-y: hidden;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.message-textarea:focus {
  border-color: var(--sky-500);
  box-shadow: 0 0 0 3px rgba(14,165,233,.1);
  background: #fff;
}
.btn-send {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--sky-500);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}
.btn-send:hover:not(.disabled) { background: var(--sky-600); transform: scale(1.05); }
.btn-send.disabled { background: var(--gray-200); cursor: not-allowed; }

/* ── File / Image Attachments ─────────────────────────────── */
.btn-attach {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%; cursor: pointer;
  color: var(--gray-400); transition: color .15s, background .15s;
}
.btn-attach:hover { color: var(--sky-500); background: var(--gray-100); }

.bubble-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(280px, 40vw);
  border-radius: 6px;
  cursor: pointer;
  object-fit: contain;
}

@media (max-width: 480px) {
  .bubble-image {
    max-width: 40vw;
  }
}

/* Image bubbles — explicit classes, no :has() for broad browser support */
.row-has-image {
  width: fit-content;
  max-width: 60%;
}
.bubble-has-image {
  width: fit-content;
  padding: 4px;
  overflow: hidden;
}

@media (max-width: 480px) {
  .message-row    { max-width: 88%; }
  .row-has-image  { max-width: 50%; }
}

.bubble-file-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 6px;
  background: rgba(0,0,0,.06); color: inherit;
  text-decoration: none; font-size: .85rem; word-break: break-all;
}
.bubble-file-link:hover { background: rgba(0,0,0,.12); }

.upload-progress, .upload-error {
  padding: 6px 16px; font-size: .8rem; text-align: center;
}
.upload-progress { color: var(--sky-600); }
.upload-error    { color: #ef4444; }

.chat-closed-banner {
  padding: 14px 20px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
}

/* ── Lightbox ─────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s ease;
}
.lightbox-inner {
  position: relative;
  width: 100%;
  height: calc(100vh - 20px);
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}
.lightbox-close {
  position: absolute; top: 8px; right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none;
  color: #fff; font-size: 1.4rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 28px 28px 24px;
  width: 100%; max-width: 440px;
  animation: slideUp .15s ease;
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal h3      { font-size: 17px; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.modal > p     { font-size: 14px; color: var(--gray-500); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.chat-link-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 13px; color: var(--gray-600);
}
.chat-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px;
}
.chat-link code {
  font-size: 13px; word-break: break-all;
  color: var(--sky-700);
  background: #e0f2fe;
  padding: 4px 8px;
  border-radius: 4px;
  flex: 1;
}
.link-copied-label { font-size: 13px; color: #16a34a; font-weight: 500; white-space: nowrap; }

/* ── Customer Chat Page ───────────────────────────────────── */
.customer-shell {
  display: flex; flex-direction: column;
  height: 100dvh;
  background: var(--gray-50);
}
.notif-banner-wrap {
  display: flex; justify-content: center;
  padding: 10px 16px 0; flex-shrink: 0;
}
.notif-banner {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fef08a; color: #713f12;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
  border-radius: 20px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  user-select: none; margin: 10px auto 0; align-self: center;
}
.notif-banner svg { flex-shrink: 0; stroke: #713f12; }
.notif-banner span { white-space: nowrap; }
.notif-banner-denied { background: #fee2e2; color: #7f1d1d; cursor: default; }
.notif-banner-denied svg { stroke: #7f1d1d; }

.customer-header {
  background: var(--sky-500);
  padding: 0 20px;
  height: 60px;
  display: flex; align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  flex-shrink: 0;
}
.customer-header-inner { display: flex; align-items: center; gap: 12px; }
.support-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.support-name   { font-weight: 700; color: #fff; font-size: 15px; }
.support-status { display: flex; align-items: center; gap: 5px; font-size: 12px; color: rgba(255,255,255,.85); }
.status-dot     { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot.online  { background: var(--green-400); }
.status-dot.offline { background: var(--gray-300); }

.customer-messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 20px 16px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.customer-input-area {
  padding: 10px 16px 14px;
  background: #fff;
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.name-prompt {
  display: flex; flex-direction: column; gap: 10px;
  font-size: 14px; color: var(--gray-600);
}
.name-prompt-row { display: flex; gap: 10px; }
.name-prompt-row .form-control { flex: 1; }

.customer-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100vh; gap: 16px; color: var(--gray-500); font-size: 14px;
}
.customer-error {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100vh; gap: 12px; text-align: center; padding: 40px;
  color: var(--gray-600);
}
.customer-error h2 { font-size: 22px; font-weight: 700; color: var(--gray-800); }

/* ── Blazor error UI ──────────────────────────────────────── */
#blazor-error-ui {
  background: #fffbe6;
  border-top: 1px solid #ffe58f;
  display: none; overflow: hidden;
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 10px 18px;
  z-index: 9999; font-size: 13px;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; margin-left: 12px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }

  .sidebar {
    width: 100%; min-width: unset;
    height: auto; max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
  }

  .chat-main { height: 55vh; }

  .sidebar-actions { flex-wrap: wrap; }

  .message-row { max-width: 88%; }
}

@media (max-width: 480px) {
  .chat-panel-header { flex-wrap: wrap; gap: 8px; }
  .chat-panel-actions { width: 100%; justify-content: flex-end; }
  .login-card { padding: 24px 20px; }
}

/* ============================================================
   ADMIN SHELL – Dashboard layout
   ============================================================ */
.admin-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  background: var(--gray-50);
}

/* ── Top Navbar ───────────────────────────────────────────── */
.admin-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.admin-topbar-left { display: flex; align-items: center; gap: 14px; }
.admin-topbar-right { display: flex; align-items: center; gap: 12px; }

.admin-menu-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--gray-600);
  cursor: pointer; transition: background var(--transition);
}
.admin-menu-toggle:hover { background: var(--gray-100); }

.admin-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--gray-800);
}

.admin-topbar-user {
  display: flex; align-items: center; gap: 8px;
}
.admin-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #6366f1; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.admin-username { font-size: 13px; font-weight: 500; color: var(--gray-700); }

/* ── Left Drawer ──────────────────────────────────────────── */
.admin-drawer {
  position: fixed;
  top: 56px; left: 0; bottom: 0;
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 250ms ease;
  z-index: 90;
  overflow-y: auto;
}
.admin-drawer.open { transform: translateX(0); }

.admin-nav {
  flex: 1;
  display: flex; flex-direction: column;
  padding: 12px 8px;
  gap: 2px;
}

.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none; border-radius: var(--radius-sm);
  background: transparent;
  font-size: 14px; font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-align: left;
}
.admin-nav-item:hover { background: var(--gray-50); color: var(--gray-800); }
.admin-nav-item.active {
  background: rgba(99,102,241,.08);
  color: #6366f1;
}
.admin-nav-icon {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex-shrink: 0;
}
.admin-nav-label { white-space: nowrap; }
.admin-nav-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 10px;
  background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700;
  line-height: 1.4;
}

.admin-drawer-footer {
  padding: 8px;
  border-top: 1px solid var(--gray-100);
}
.admin-nav-logout { color: var(--red-500); }
.admin-nav-logout:hover { background: rgba(239,68,68,.06); color: var(--red-600); }

.admin-drawer-overlay {
  display: none;
}

/* ── Main Content ─────────────────────────────────────────── */
.admin-content {
  margin-top: 56px;
  margin-left: 0;
  flex: 1;
  padding: 0;
  transition: margin-left 250ms ease;
  min-height: calc(100vh - 56px);
}
.admin-content.drawer-open {
  margin-left: 240px;
}

/* ── Admin Pages ──────────────────────────────────────────── */
.admin-page {
  padding: 28px 32px;
  max-width: 1200px;
}
.admin-page-header { margin-bottom: 24px; }
.admin-page-header h1 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.admin-page-subtitle { font-size: 14px; color: var(--gray-500); margin-top: 4px; }

/* ── Stats Grid ───────────────────────────────────────────── */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.admin-stat-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.admin-stat-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; flex-shrink: 0;
}
.admin-stat-body { display: flex; flex-direction: column; }
.admin-stat-value { font-size: 22px; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.admin-stat-label { font-size: 13px; color: var(--gray-500); }

/* ── Cards & Tables ───────────────────────────────────────── */
.admin-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.admin-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.admin-card-header h2 { font-size: 15px; font-weight: 600; color: var(--gray-800); }

.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 12px; font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .03em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.admin-table tbody tr:hover { background: var(--gray-50); }
.admin-table-user {
  display: flex; align-items: center; gap: 10px;
  font-weight: 500;
}
.admin-avatar-xs {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--sky-500); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.admin-table-meta { color: var(--gray-400); font-size: 13px; }

.admin-btn-ghost {
  padding: 5px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px; font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition);
}
.admin-btn-ghost:hover { border-color: var(--sky-500); color: var(--sky-500); }

/* ── Badges ───────────────────────────────────────────────── */
.admin-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 12px; font-weight: 600;
}
.badge-active  { background: rgba(34,197,94,.12); color: #16a34a; }
.badge-draft   { background: rgba(234,179,8,.12);  color: #854d0e; }
.badge-closed  { background: var(--gray-100); color: var(--gray-500); }
.badge-unread  { background: rgba(239,68,68,.12); color: #dc2626; }

/* ── Empty State ──────────────────────────────────────────── */
.admin-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 14px;
}
.admin-empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 24px;
  gap: 12px;
  text-align: center;
}
.admin-empty-state h3 { font-size: 16px; font-weight: 600; color: var(--gray-700); }
.admin-empty-state p { font-size: 14px; color: var(--gray-400); max-width: 320px; }

/* ── Chat Section Shell ───────────────────────────────────── */
.admin-chat-shell {
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
}
.admin-chat-shell .sidebar {
  border-top: none;
}
.admin-chat-shell .chat-main {
  flex: 1;
}

/* ── Responsive Drawer ────────────────────────────────────── */
@media (max-width: 1024px) {
  .admin-drawer-overlay {
    display: block;
    position: fixed; inset: 0;
    top: 56px;
    background: rgba(0,0,0,.3);
    z-index: 85;
  }
  .admin-content.drawer-open {
    margin-left: 0;
  }
}

/* ============================================================
   POS LAYOUT – Persistent sidebar + queue styles
   ============================================================ */

/* Desktop: sidebar dark theme, visibility controlled by .open class */
@media (min-width: 1025px) {
  .admin-drawer {
    background: #18183a;
    border-right: none;
    box-shadow: 2px 0 12px rgba(0,0,0,.18);
  }
  .admin-drawer-overlay { display: none !important; }
  .admin-topbar         { background: #fff; border-bottom: 1px solid #e5e7eb; }
  .admin-topbar-left    { gap: 10px; }

  /* Dark sidebar items */
  .admin-nav-item       { color: rgba(255,255,255,.6); }
  .admin-nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
  .admin-nav-item.active{ background: rgba(139,92,246,.25); color: #c4b5fd; }
  .admin-brand span     { color: #fff; }
  .admin-drawer-footer  { border-top-color: rgba(255,255,255,.1); }
  .admin-nav            { padding: 16px 10px; gap: 3px; }
  .admin-nav-section-label {
    padding: 14px 14px 4px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: rgba(255,255,255,.3);
  }
}

/* Topbar: stats chips */
.pos-topbar-stats {
  display: flex; align-items: center; gap: 8px;
  margin-left: 20px;
}
.pos-stat-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: opacity .15s;
}
.pos-stat-chip:hover { opacity: .85; }
.pos-stat-chip.deposits  { background: rgba(34,197,94,.12);  color: #16a34a; }
.pos-stat-chip.cashouts  { background: rgba(236,72,153,.12);  color: #be185d; }
.pos-stat-chip.chat      { background: rgba(99,102,241,.12);  color: #4f46e5; }
.pos-stat-chip.zero      { background: var(--gray-100); color: var(--gray-400); }

/* ── Queue grid ───────────────────────────────────────────── */
.pos-queue-page { padding: 20px 24px; }
.pos-queue-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.pos-queue-header h1 { font-size: 20px; font-weight: 700; color: var(--gray-900); }
.pos-queue-tabs {
  display: flex; gap: 4px;
  background: var(--gray-100);
  border-radius: 10px; padding: 3px;
}
.pos-queue-tab {
  padding: 6px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  border: none; background: transparent;
  color: var(--gray-500); cursor: pointer;
  transition: all .15s;
}
.pos-queue-tab.active { background: #fff; color: var(--gray-900); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.pos-queue-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .pos-queue-cols { grid-template-columns: 1fr; } }

.pos-col-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.pos-col-header h2 { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.pos-col-count {
  padding: 2px 9px; border-radius: 10px;
  font-size: 12px; font-weight: 700;
}

/* ── Request card ─────────────────────────────────────────── */
.pos-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  transition: box-shadow .15s;
}
.pos-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.pos-card-top {
  display: flex; align-items: flex-start;
  padding: 14px 16px 10px;
  gap: 12px;
}
.pos-card-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.pos-card-info { flex: 1; min-width: 0; }
.pos-card-name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.pos-card-meta { font-size: 12px; color: var(--gray-400); margin-top: 1px; }
.pos-card-amount {
  text-align: right; flex-shrink: 0;
}
.pos-card-amount-val {
  font-size: 20px; font-weight: 800; line-height: 1.1;
}
.pos-card-amount-method {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--gray-400);
}
.pos-card-note {
  padding: 0 16px 10px;
  font-size: 12px; color: var(--gray-500);
  font-style: italic;
}
.pos-card-actions {
  display: flex; gap: 0;
  border-top: 1px solid var(--gray-100);
}
.pos-card-actions button {
  flex: 1; padding: 10px;
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  transition: background .15s;
}
.pos-btn-approve  { background: #f0fdf4; color: #16a34a; }
.pos-btn-approve:hover { background: #dcfce7; }
.pos-btn-reject   { background: #fef2f2; color: #dc2626; border-left: 1px solid var(--gray-100); }
.pos-btn-reject:hover { background: #fee2e2; }
.pos-btn-process  { background: #eff6ff; color: #1d4ed8; }
.pos-btn-process:hover { background: #dbeafe; }
.pos-btn-view     { background: var(--gray-50); color: var(--gray-600); border-left: 1px solid var(--gray-100); }
.pos-btn-view:hover { background: var(--gray-100); }
.pos-card-screenshot {
  margin: 0 16px 10px;
  border-radius: 8px; overflow: hidden;
  max-height: 120px;
  border: 1px solid var(--gray-100);
  cursor: pointer;
}
.pos-card-screenshot img { width: 100%; height: 120px; object-fit: cover; }

.pos-empty {
  padding: 32px 20px; text-align: center;
  background: #fff; border: 1px dashed var(--gray-200);
  border-radius: 12px; color: var(--gray-400); font-size: 14px;
}

/* ── Home overview ────────────────────────────────────────── */
.pos-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.pos-home-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 12px; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.pos-home-card-label { font-size: 12px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .04em; }
.pos-home-card-value { font-size: 26px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.pos-home-card-sub   { font-size: 12px; color: var(--gray-400); }

.pos-recent-section { margin-bottom: 24px; }
.pos-recent-title {
  font-size: 14px; font-weight: 700; color: var(--gray-700);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.pos-recent-list { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 768px) {
  .admin-page { padding: 20px 16px; }
  .admin-stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-username { display: none; }
  .admin-chat-shell { flex-direction: column; }
  .admin-chat-shell .sidebar {
    width: 100%; min-width: unset;
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
  }
}

@media (max-width: 480px) {
  .admin-stats-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   CHIME MANAGEMENT – Form & Table styles
   ============================================================ */

/* ── Form ─────────────────────────────────────────────────── */
.chime-form { padding: 20px; }
.chime-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.chime-form-full { grid-column: 1 / -1; }
.chime-form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}
.chime-limit-hint {
  font-weight: 400;
  color: var(--gray-400);
  font-size: 12px;
}

/* ── Filters ──────────────────────────────────────────────── */
.chime-filter-row {
  display: flex; gap: 8px;
}
.chime-filter-select {
  width: auto; min-width: 120px;
  padding: 5px 10px;
  font-size: 13px;
}

/* ── Table extras ─────────────────────────────────────────── */
.chime-tag {
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--gray-700);
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
}
.chime-mono {
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  font-weight: 500;
}
.chime-qr-indicator {
  display: inline-flex; align-items: center; justify-content: center;
  color: #6366f1;
  cursor: help;
}
.chime-qr-img {
  width: 200px;
  height: auto;
  border-radius: 6px;
  display: block;
}
.chime-qr-thumb {
  width: 200px;
  height: auto;
  border-radius: 6px;
  cursor: zoom-in;
  display: block;
}
.chime-row-actions {
  display: flex; gap: 6px;
}
.chime-btn-danger {
  color: var(--red-500) !important;
  border-color: rgba(239,68,68,.25) !important;
}
.chime-btn-danger:hover {
  color: #fff !important;
  background: var(--red-500) !important;
  border-color: var(--red-500) !important;
}

/* ── Chime badges ─────────────────────────────────────────── */
.badge-holding { background: rgba(99,102,241,.1); color: #6366f1; }
.badge-paying  { background: rgba(14,165,233,.1); color: #0ea5e9; }

/* ── Chime responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .chime-form-grid { grid-template-columns: 1fr; }
  .chime-filter-row { flex-direction: column; }
  .chime-filter-select { min-width: unset; width: 100%; }
  .chime-row-actions { flex-direction: column; }
}


/* ── Settings ─────────────────────────────────────────────────────────────── */

.settings-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gray-100);
    padding-bottom: 0;
}
.settings-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-400);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.settings-tab:hover { color: var(--gray-700); }
.settings-tab.active { color: #6366f1; border-bottom-color: #6366f1; font-weight: 600; }

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 680px;
}
.settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.settings-field > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    display: block;
}
.settings-field > label small { font-weight: 400; color: var(--gray-400); margin-left: 4px; }
.settings-field input[type=text],
.settings-field input[type=email],
.settings-field input[type=password],
.settings-field input[type=number],
.settings-field textarea,
.settings-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    color: var(--gray-900);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.settings-field input:focus,
.settings-field textarea:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.settings-field textarea { resize: vertical; min-height: 90px; }
.settings-field input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.settings-field input[type=number]::-webkit-outer-spin-button,
.settings-field input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.settings-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.settings-field-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
}
.settings-field-inline input[type=checkbox] {
    width: 18px; height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
}

.settings-divider { height: 1px; background: var(--gray-100); margin: 4px 0; }

.settings-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}
.settings-msg.ok  { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.settings-msg.err { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.btn-settings-save {
    align-self: flex-start;
    padding: 10px 24px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.btn-settings-save:hover:not(:disabled) { background: #4f46e5; }
.btn-settings-save:disabled { opacity: .55; cursor: not-allowed; }

.btn-settings-cancel {
    align-self: flex-start;
    padding: 10px 24px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-settings-cancel:hover { background: var(--gray-200); }

.btn-add {
    padding: 8px 16px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-add:hover { background: #4f46e5; }

.btn-edit {
    padding: 6px 14px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}
.btn-edit:hover { background: var(--gray-200); }

.btn-delete {
    padding: 6px 14px;
    background: #fef2f2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}
.btn-delete:hover { background: #fee2e2; }

.settings-platform-list { display: flex; flex-direction: column; padding: 0 20px; }
.settings-platform-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
}
.settings-platform-row:last-child { border-bottom: none; }
.settings-platform-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.platform-name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.platform-key  { font-size: 12px; color: var(--gray-400); font-family: monospace; letter-spacing: .02em; }
.platform-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}
.platform-status.active   { background: #f0fdf4; color: #16a34a; }
.platform-status.inactive { background: var(--gray-100); color: var(--gray-400); }
.platform-actions { display: flex; gap: 8px; }

@media (max-width: 640px) {
    .settings-row-2 { grid-template-columns: 1fr; }
    .settings-platform-row { flex-wrap: wrap; }
}

/* ── Payment Platforms ────────────────────────────────────────────────────── */
.payment-platform-grid { display: flex; flex-direction: column; gap: 10px; }

.payment-platform-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
    cursor: default;
}
.payment-platform-card:hover  { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99,102,241,.06); }
.payment-platform-card.selected { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

.payment-platform-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.payment-platform-icon-sm {
    width: 26px; height: 26px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.payment-platform-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.payment-platform-name { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.payment-platform-desc { font-size: 12px; color: var(--gray-400); }

.payment-platform-status {
    font-size: 12px; font-weight: 600;
    padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}
.payment-platform-status.active   { background: #f0fdf4; color: #16a34a; }
.payment-platform-status.inactive { background: var(--gray-100); color: var(--gray-400); }

.payment-platform-btn {
    padding: 8px 18px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: none; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    transition: background .15s, color .15s;
}
.payment-platform-btn:hover { background: #6366f1; color: #fff; }
.payment-platform-card.selected .payment-platform-btn { background: #6366f1; color: #fff; }

/* ── Modal Dialog ─────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    width: 100%; max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp .15s ease;
}
@keyframes slideUp { from { transform: translateY(16px); opacity:0; } to { transform: translateY(0); opacity:1; } }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--gray-100);
    position: sticky; top: 0; background: #fff; border-radius: 14px 14px 0 0;
    z-index: 1;
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--gray-900); margin: 0; }
.modal-close {
    width: 30px; height: 30px; border-radius: 8px;
    border: none; background: var(--gray-100);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--gray-500);
    font-size: 18px; line-height: 1;
    transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-900); }
.modal-body { padding: 20px; }
.modal-footer {
    display: flex; gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 14px 14px;
}

/* ── Transaction Filter Bar ───────────────────────────────────────────────── */
.txn-filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.txn-filter-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.txn-filter-icon {
    position: absolute;
    left: 12px;
    color: var(--gray-400);
    pointer-events: none;
    flex-shrink: 0;
}

.txn-filter-input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    color: var(--gray-900);
    background: var(--gray-50);
    outline: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
    font-family: inherit;
}
.txn-filter-input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.txn-filter-input::placeholder { color: var(--gray-400); }

/* Date input — suppress default calendar icon so our SVG shows */
.txn-date-input::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.txn-filter-btn-apply {
    padding: 9px 20px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    flex-shrink: 0;
}
.txn-filter-btn-apply:hover { background: #4f46e5; }

.txn-filter-btn-clear {
    padding: 9px 16px;
    background: transparent;
    color: var(--gray-500);
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    flex-shrink: 0;
}
.txn-filter-btn-clear:hover { border-color: var(--gray-400); color: var(--gray-700); }

/* ============================================================
   POS RESPONSIVE – sidebar + topbar + content
   ============================================================ */

/* Desktop (≥1025px): overlay hidden, layout controlled by inline styles */
@media (min-width: 1025px) {
  .admin-drawer-overlay { display: none !important; }
}

/* Mobile (<1025px): sidebar is a drawer, topbar full-width */
@media (max-width: 1024px) {
  .pos-sidebar             { transform: translateX(-100%); transition: transform 250ms ease; }
  .pos-sidebar.open        { transform: translateX(0); }
  .pos-hamburger           { display: flex !important; }

  /* Stack the home stat cards 2-up on mobile */
  .pos-home-stat-grid      { grid-template-columns: 1fr 1fr !important; }
  /* Stack the queue/activity columns on mobile */
  .pos-home-queue-cols,
  .pos-home-activity-cols  { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .pos-home-stat-grid      { grid-template-columns: 1fr !important; }
}

@media (max-width: 999px) {
  /* ── Tab bar ── */
  .mobile-tab-bar {
    display: flex !important;
    gap: 8px;
    padding: 10px 10px 0;
    flex-shrink: 0;
  }

  /* ── Grid becomes single full-height column ── */
  .home-grid {
    grid-template-columns: 1fr !important;
    overflow: visible !important;
    padding: 10px !important;
  }

  /* Both columns stack, but only active tab visible */
  .home-chat-col,
  .home-queue-col {
    order: unset !important;
    min-height: 0 !important;
  }

  /* Chat tab: show chat, hide queue */
  .home-grid.mobile-tab-chat .home-queue-col { display: none !important; }
  .home-grid.mobile-tab-chat .home-chat-col  { display: flex !important; height: calc(100vh - 170px); }

  /* Deposits tab: show queue (deposits only), hide chat */
  .home-grid.mobile-tab-deposits .home-chat-col  { display: none !important; }
  .home-grid.mobile-tab-deposits .home-queue-col { display: flex !important; flex-direction: column; height: calc(100vh - 170px); overflow-y: auto; }
  .home-grid.mobile-tab-deposits .cashouts-panel { display: none !important; }
  .home-grid.mobile-tab-deposits .deposits-panel { flex: 1 !important; min-height: 0 !important; }

  /* Cashouts tab: show queue (cashouts only), hide chat */
  .home-grid.mobile-tab-cashouts .home-chat-col  { display: none !important; }
  .home-grid.mobile-tab-cashouts .home-queue-col { display: flex !important; flex-direction: column; height: calc(100vh - 170px); overflow-y: auto; }
  .home-grid.mobile-tab-cashouts .deposits-panel { display: none !important; }
  .home-grid.mobile-tab-cashouts .cashouts-panel { flex: 1 !important; min-height: 0 !important; }

  /* ── Chat messenger layout within chat tab ── */
  .home-chat-col .chat-sidebar {
    width: 100% !important;
    border-right: none !important;
  }
  .home-chat-col .chat-messages {
    display: none !important;
  }
  .home-chat-col.chat-session-open .chat-sidebar  { display: none !important; }
  .home-chat-col.chat-session-open .chat-messages {
    display: flex !important;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  .home-chat-col.chat-session-open .chat-back-btn { display: flex !important; }
  .home-chat-col.chat-session-open .chat-messages .chat-panel {
    flex: 1;
    min-height: 0;
    height: auto;
  }
}
