/* QR Restaurant Manager — Manager Dashboard */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');

.qrm-dashboard {
  --bg:         #0f0f14;
  --bg2:        #18181f;
  --bg3:        #21212b;
  --border:     rgba(255,255,255,0.08);
  --text:       #e8e8ef;
  --muted:      #888899;
  --accent:     #e94560;
  --accent2:    #f5a623;
  --green:      #22c55e;
  --blue:       #60a5fa;
  --radius:     12px;
  --font-head:  'DM Serif Display', Georgia, serif;
  --font-body:  'DM Sans', system-ui, sans-serif;

  background:   var(--bg);
  color:        var(--text);
  font-family:  var(--font-body);
  min-height:   100vh;
  padding:      0;
  margin:       0 -20px; /* bleed past WP content padding */
}

/* ── Login Screen ─────────────────────────────────────────────────────────── */
.qrm-login-screen {
  display:         flex;
  align-items:     center;
  justify-content: center;
  min-height:      100vh;
  padding:         24px;
}

.qrm-login-box {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       48px 40px;
  max-width:     380px;
  width:         100%;
  text-align:    center;
}

.qrm-login-logo {
  font-family:   var(--font-head);
  font-size:     28px;
  margin-bottom: 6px;
  color:         var(--text);
}

.qrm-login-sub {
  color:         var(--muted);
  font-size:     14px;
  margin-bottom: 32px;
}

.qrm-login-form input[type=password] {
  width:         100%;
  background:    var(--bg3);
  border:        1px solid var(--border);
  border-radius: 8px;
  color:         var(--text);
  font-family:   var(--font-body);
  font-size:     16px;
  padding:       14px 16px;
  box-sizing:    border-box;
  margin-bottom: 16px;
  outline:       none;
  transition:    border-color 0.2s;
}

.qrm-login-form input[type=password]:focus {
  border-color: var(--accent);
}

.qrm-btn-login {
  width:         100%;
  background:    var(--accent);
  color:         #fff;
  border:        none;
  border-radius: 8px;
  font-family:   var(--font-body);
  font-size:     15px;
  font-weight:   600;
  padding:       14px;
  cursor:        pointer;
  transition:    opacity 0.2s;
}
.qrm-btn-login:hover { opacity: 0.88; }
.qrm-btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

.qrm-login-error {
  color:       var(--accent);
  font-size:   13px;
  margin-top:  10px;
  display:     none;
}

/* ── App Screen ──────────────────────────────────────────────────────────── */
.qrm-app-screen { display: none; }

.qrm-header {
  background:    var(--bg2);
  border-bottom: 1px solid var(--border);
  padding:       18px 28px;
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  position:      sticky;
  top:           0;
  z-index:       100;
}

.qrm-header-title {
  font-family: var(--font-head);
  font-size:   22px;
  color:       var(--text);
}

.qrm-header-sub {
  font-size: 13px;
  color:     var(--muted);
  margin-top: 2px;
}

.qrm-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.qrm-btn-outline {
  background:    transparent;
  border:        1px solid var(--border);
  border-radius: 8px;
  color:         var(--muted);
  font-family:   var(--font-body);
  font-size:     13px;
  padding:       8px 14px;
  cursor:        pointer;
  transition:    border-color 0.2s, color 0.2s;
}
.qrm-btn-outline:hover { border-color: var(--text); color: var(--text); }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.qrm-tabs {
  display:       flex;
  gap:           4px;
  padding:       16px 28px 0;
  border-bottom: 1px solid var(--border);
  background:    var(--bg2);
}

.qrm-tab {
  background:    transparent;
  border:        none;
  border-bottom: 2px solid transparent;
  color:         var(--muted);
  cursor:        pointer;
  font-family:   var(--font-body);
  font-size:     14px;
  font-weight:   500;
  padding:       10px 18px;
  margin-bottom: -1px;
  transition:    color 0.15s, border-color 0.15s;
}

.qrm-tab:hover { color: var(--text); }

.qrm-tab--active {
  color:         var(--text);
  border-color:  var(--accent);
}

/* ── Panels ──────────────────────────────────────────────────────────────── */
.qrm-panel {
  display: none;
  padding: 28px;
}
.qrm-panel--active { display: block; }

/* ── Messages ─────────────────────────────────────────────────────────────── */
.qrm-messages-header {
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.qrm-messages-header h2 {
  font-family: var(--font-head);
  font-size:   20px;
  margin:      0;
}

.qrm-btn-refresh {
  background:    var(--bg3);
  border:        1px solid var(--border);
  border-radius: 8px;
  color:         var(--text);
  font-family:   var(--font-body);
  font-size:     13px;
  padding:       8px 14px;
  cursor:        pointer;
  transition:    background 0.15s;
}
.qrm-btn-refresh:hover { background: var(--bg); }

#qrm-messages-list {
  display:        flex;
  flex-direction: column;
  gap:            10px;
}

.qrm-msg-card {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  border-left:   3px solid var(--blue);
  padding:       14px 18px;
  opacity:       0;
  transform:     translateY(-6px);
  transition:    opacity 0.3s, transform 0.3s;
}

.qrm-msg-card.qrm-msg--visible {
  opacity:   1;
  transform: translateY(0);
}

.qrm-msg-tag {
  font-size:     11px;
  font-weight:   600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.qrm-msg-tag--waiter { color: var(--accent2); }
.qrm-msg-tag--bill   { color: var(--accent);  }
.qrm-msg-tag--info   { color: var(--blue);    }

.qrm-msg-card:has(.qrm-msg-tag--waiter) { border-left-color: var(--accent2); }
.qrm-msg-card:has(.qrm-msg-tag--bill)   { border-left-color: var(--accent);  }

.qrm-msg-text {
  color:       var(--text);
  font-size:   15px;
  margin:      0 0 6px;
  line-height: 1.5;
}

.qrm-msg-time {
  color:     var(--muted);
  font-size: 12px;
}

.qrm-empty-msg {
  color:      var(--muted);
  text-align: center;
  padding:    60px 0;
  font-size:  15px;
}

/* ── Menu Items ──────────────────────────────────────────────────────────── */
.qrm-menu-header {
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap:     wrap;
  gap:           12px;
}

.qrm-menu-header h2 {
  font-family: var(--font-head);
  font-size:   20px;
  margin:      0;
}

#qrm-category-filter {
  display: flex;
  gap:     8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.qrm-pill {
  background:    var(--bg3);
  border:        1px solid var(--border);
  border-radius: 50px;
  color:         var(--muted);
  cursor:        pointer;
  font-family:   var(--font-body);
  font-size:     13px;
  padding:       6px 14px;
  transition:    all 0.15s;
}
.qrm-pill:hover { border-color: var(--text); color: var(--text); }
.qrm-pill--active {
  background:   var(--accent);
  border-color: var(--accent);
  color:        #fff;
}

#qrm-menu-list {
  display:        flex;
  flex-direction: column;
  gap:            8px;
}

.qrm-menu-row {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  padding:       14px 18px;
  transition:    opacity 0.2s, background 0.2s;
}

.qrm-menu-row--hidden {
  opacity: 0.45;
  background: var(--bg);
}

.qrm-menu-row--loading { opacity: 0.6; pointer-events: none; }

.qrm-menu-info {
  display:     flex;
  align-items: center;
  gap:         12px;
  flex-wrap:   wrap;
}

.qrm-menu-name  { font-size: 15px; font-weight: 500; }
.qrm-menu-cat   { background: var(--bg3); border-radius: 50px; color: var(--muted); font-size: 12px; padding: 3px 10px; }
.qrm-menu-price { color: var(--accent2); font-size: 14px; font-weight: 600; }

/* ── Toggle switch ────────────────────────────────────────────────────────── */
.qrm-toggle {
  position:  relative;
  display:   inline-block;
  flex-shrink: 0;
  cursor:    pointer;
}

.qrm-toggle input {
  opacity:  0;
  width:    0;
  height:   0;
  position: absolute;
}

.qrm-toggle-track {
  display:       block;
  width:         44px;
  height:        24px;
  background:    var(--bg3);
  border:        1px solid var(--border);
  border-radius: 50px;
  position:      relative;
  transition:    background 0.2s;
}

.qrm-toggle-track::after {
  content:       '';
  position:      absolute;
  top:           2px;
  left:          2px;
  width:         18px;
  height:        18px;
  background:    var(--muted);
  border-radius: 50%;
  transition:    transform 0.2s, background 0.2s;
}

.qrm-toggle input:checked + .qrm-toggle-track {
  background:   var(--green);
  border-color: var(--green);
}

.qrm-toggle input:checked + .qrm-toggle-track::after {
  transform:  translateX(20px);
  background: #fff;
}

/* ── WP Admin styles ─────────────────────────────────────────────────────── */
.qrm-wrap h1 { font-size: 22px; margin-bottom: 20px; }
.qrm-cards   { display: flex; flex-direction: column; gap: 20px; max-width: 800px; }
.qrm-card    { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 24px; }
.qrm-card h2 { font-size: 16px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid #eee; }

@media (max-width: 600px) {
  .qrm-header { padding: 14px 16px; }
  .qrm-panel  { padding: 16px; }
  .qrm-tabs   { padding: 12px 16px 0; gap: 0; }
  .qrm-tab    { padding: 10px 12px; font-size: 13px; }
  .qrm-dashboard { margin: 0 -10px; }
}
