/* ═══════════════════════════════════════════════════════════
   NEXO Portal — Stylesheet
   Design system: dark, borders-only, zero shadows, zero gradients
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg-base: #0A0A0A;
  --bg-surface: #141414;
  --bg-elevated: #1C1C1C;
  --bg-hover: #212121;
  --border: rgba(255,255,255,0.07);
  --border-md: rgba(255,255,255,0.12);
  --border-strong: rgba(255,255,255,0.18);
  --text-primary: #F5F5F5;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent: #FFFFFF;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --whatsapp: #25D366;
  --nav-h: 56px;
  --sidebar-w: 220px;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }

/* ── Focus ─────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */

.portal-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
}

.portal-logo {
  font-weight: 800; font-size: 16px; letter-spacing: -0.02em;
  color: var(--text-primary);
  transition: opacity 150ms ease;
}
.portal-logo:hover { opacity: 0.7; }

.portal-client-name {
  color: var(--text-secondary); font-size: 13px;
  padding-left: 14px; border-left: 1px solid var(--border-md);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.portal-nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.portal-avatar {
  position: relative;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-elevated); border: 1px solid var(--border-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  cursor: pointer; user-select: none;
  transition: border-color 150ms ease, color 150ms ease;
}
.portal-avatar:hover { border-color: var(--border-strong); color: var(--text-primary); }

.portal-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px;
  background: var(--bg-elevated); border: 1px solid var(--border-md);
  border-radius: 10px; padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
  cursor: default;
}
.portal-dropdown.visible { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-email {
  padding: 8px 10px; font-size: 12px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dropdown-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: none; background: transparent;
  border-radius: 6px; font-size: 13px; cursor: pointer;
  transition: background 150ms ease;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item--danger { color: var(--danger); }

/* Sidebar */
.portal-sidebar {
  position: fixed; top: var(--nav-h); left: 0; bottom: 0; z-index: 40;
  width: var(--sidebar-w);
  padding: 16px 10px;
  background: var(--bg-base);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}

.sidebar-group-label {
  font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted, var(--text-secondary)); opacity: .65;
  padding: 14px 12px 5px;
}
.sidebar-group-label:first-child { padding-top: 2px; }

.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: color 150ms ease, background 150ms ease, transform 120ms ease;
  min-height: 38px;
}
.sidebar-item:hover { transform: translateX(2px); }
.sidebar-item svg { flex-shrink: 0; opacity: 0.8; }
.sidebar-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar-item:active { background: var(--bg-elevated); }
.sidebar-item.active { color: var(--text-primary); background: var(--bg-surface); }

/* ── Personalização por cliente (brandColor do menu) ── */
.sidebar-item { position: relative; }
body.has-brand .sidebar-item.active::before {
  content: '';
  position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 2px; border-radius: 2px;
  background: var(--brand);
}
body.has-brand .portal-avatar { border-color: var(--brand); }
@media (max-width: 768px) {
  body.has-brand .sidebar-item.active::before {
    top: 0; bottom: auto; left: 12px; right: 12px;
    width: auto; height: 2px;
  }
}

/* Content */
.portal-main {
  margin-left: var(--sidebar-w);
  padding: calc(var(--nav-h) + 28px) 28px 60px;
  max-width: 1100px;
}

.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.page-header { margin-bottom: 24px; }

/* ═══════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 18px;
  border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: all 150ms ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover:not(:disabled) { background: #E2E2E2; }
.btn-primary:active:not(:disabled) { background: #CFCFCF; transform: scale(0.985); }

.btn-secondary { background: transparent; border-color: var(--border-md); color: var(--text-secondary); }
.btn-secondary:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text-primary); }
.btn-secondary:active:not(:disabled) { background: var(--bg-hover); transform: scale(0.985); }

.btn-danger { background: rgba(239,68,68,0.1); color: var(--danger); border-color: rgba(239,68,68,0.2); }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.16); border-color: rgba(239,68,68,0.35); }
.btn-danger:active:not(:disabled) { transform: scale(0.985); }

.btn-success { background: rgba(34,197,94,0.1); color: var(--success); border-color: rgba(34,197,94,0.2); }
.btn-success:hover:not(:disabled) { background: rgba(34,197,94,0.16); border-color: rgba(34,197,94,0.35); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 7px; }
.btn-full { width: 100%; }

.btn-whatsapp { background: rgba(37,211,102,0.1); color: var(--whatsapp); border-color: rgba(37,211,102,0.2); }
.btn-whatsapp:hover:not(:disabled) { background: rgba(37,211,102,0.16); border-color: rgba(37,211,102,0.35); }

/* Spinner */
.spinner {
  width: 14px; height: 14px; flex-shrink: 0;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Inputs ────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field-label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-md);
  border-radius: 8px;
  height: 40px; padding: 0 14px;
  font-size: 14px; color: var(--text-primary);
  transition: border-color 150ms ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--border-strong); outline: none; }
.input.input-error, .textarea.input-error { border-color: var(--danger); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.select option { background: var(--bg-elevated); }

.textarea { height: auto; min-height: 100px; padding: 10px 14px; resize: vertical; line-height: 1.5; }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 42px; }
.input-icon-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 6px;
  color: var(--text-muted); cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}
.input-icon-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

.field-error { color: var(--danger); font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.field-hint { color: var(--text-muted); font-size: 12px; margin-top: 6px; }

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--success { background: rgba(34,197,94,0.1); color: var(--success); border-color: rgba(34,197,94,0.2); }
.badge--warning { background: rgba(245,158,11,0.1); color: var(--warning); border-color: rgba(245,158,11,0.2); }
.badge--danger { background: rgba(239,68,68,0.1); color: var(--danger); border-color: rgba(239,68,68,0.2); }
.badge--info { background: rgba(59,130,246,0.1); color: var(--info); border-color: rgba(59,130,246,0.2); }
.badge--muted { background: transparent; color: var(--text-muted); border-color: var(--border); }

.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-dot--pulse { animation: pulse-dot 1.6s ease infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Tables ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 150ms ease; }
.table tbody tr:hover { background: rgba(255,255,255,0.015); }

/* ── Toasts ────────────────────────────────────────────── */
.nexo-toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.nexo-toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-md);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  transform: translateX(110%); opacity: 0;
  transition: transform 250ms ease, opacity 250ms ease;
  pointer-events: auto;
}
.nexo-toast.visible { transform: translateX(0); opacity: 1; }
.toast-icon {
  width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.nexo-toast--success .toast-icon { background: rgba(34,197,94,0.15); color: var(--success); }
.nexo-toast--error .toast-icon { background: rgba(239,68,68,0.15); color: var(--danger); }
.nexo-toast--warning .toast-icon { background: rgba(245,158,11,0.15); color: var(--warning); }
.nexo-toast--info .toast-icon { background: rgba(59,130,246,0.15); color: var(--info); }

/* ── Skeleton ──────────────────────────────────────────── */
.nexo-skeleton {
  background: var(--bg-elevated);
  border-radius: 6px;
  animation: shimmer 1.5s ease infinite;
}
@keyframes shimmer { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms;
}
.modal-overlay.visible { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-md);
  border-radius: 14px;
  padding: 24px;
  transform: translateY(10px) scale(0.98);
  transition: transform 200ms ease;
}
.modal-overlay.visible .modal { transform: translateY(0) scale(1); }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.modal-body { color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ── Toggle switch ─────────────────────────────────────── */
.toggle {
  position: relative;
  width: 44px; height: 24px; flex-shrink: 0;
  border-radius: 999px;
  background: rgba(239,68,68,0.35);
  border: 1px solid rgba(239,68,68,0.4);
  cursor: pointer; padding: 0;
  transition: background 150ms ease, border-color 150ms ease;
}
.toggle::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  transition: transform 150ms ease;
}
.toggle[aria-checked="true"] { background: rgba(34,197,94,0.4); border-color: rgba(34,197,94,0.5); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); }
.toggle:disabled { opacity: 0.5; cursor: not-allowed; }
.toggle:hover:not(:disabled) { border-color: var(--border-strong); }

/* ── Empty states ──────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 20px; gap: 8px;
}
.empty-state svg { width: 32px; height: 32px; color: var(--text-muted); margin-bottom: 4px; }
.empty-title { color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.empty-sub { color: var(--text-muted); font-size: 12px; max-width: 280px; }
.empty-state .btn { margin-top: 10px; }

/* ── Misc utilities ────────────────────────────────────── */
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.flex { display: flex; } .flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════════════
   PAGE-SPECIFIC
   ═══════════════════════════════════════════════════════════ */

/* ── Login ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px;
}
.login-corner-logo { position: absolute; top: 24px; left: 28px; font-weight: 800; font-size: 16px; }
.login-corner-back {
  position: absolute; top: 26px; right: 28px;
  color: var(--text-muted); font-size: 13px;
  transition: color 150ms ease;
}
.login-corner-back:hover { color: var(--text-primary); }
.login-card {
  width: 380px; max-width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px;
}
.login-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.login-sub { color: var(--text-secondary); font-size: 13px; margin-top: 4px; margin-bottom: 28px; }
.login-footer { margin-top: 24px; color: var(--text-muted); font-size: 13px; text-align: center; }
.login-footer a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 3px; transition: color 150ms ease; }
.login-footer a:hover { color: var(--text-primary); }
.forgot-link {
  display: block; text-align: right;
  font-size: 12px; color: var(--text-muted);
  margin: -8px 0 16px; cursor: pointer;
  background: none; border: none; width: 100%;
  transition: color 150ms ease;
}
.forgot-link:hover { color: var(--text-primary); }

/* ── Dashboard ─────────────────────────────────────────── */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.metric-card { display: flex; flex-direction: column; gap: 8px; min-height: 130px; }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); }
.metric-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.metric-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.metric-sub { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-action {
  margin-top: auto; font-size: 12px; font-weight: 500;
  color: var(--text-muted); transition: color 150ms ease;
}
.metric-action:hover { color: var(--text-primary); }

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.quick-action {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
  min-height: 56px;
}
.quick-action:hover { border-color: var(--border-strong); color: var(--text-primary); background: var(--bg-hover); }
.quick-action:active { transform: scale(0.99); }
.quick-action svg { flex-shrink: 0; }

.progress-track { height: 6px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; margin: 12px 0 16px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 400ms ease; }
.onboarding-step { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; color: var(--text-secondary); }
.onboarding-step .step-circle {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--text-muted); flex-shrink: 0;
}

/* ── Staff mode ────────────────────────────────────────── */
.live-indicator { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-size: 13px; font-weight: 500; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse-dot 1.6s ease infinite; }
.live-indicator.reconnecting { color: var(--warning); }
.live-indicator.reconnecting .live-dot { background: var(--warning); }

.call-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-md);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
  transition: opacity 300ms ease, transform 300ms ease, border-color 150ms ease;
}
.call-card.new-call { animation: pulse-amber 1s ease 3; }
@keyframes pulse-amber {
  0%,100% { border-color: var(--border-md); }
  50% { border-color: rgba(245,158,11,0.6); }
}
.call-card.resolving { opacity: 0; transform: translateX(12px); }
.call-table { font-size: 18px; font-weight: 700; }
.call-time { font-size: 12px; color: var(--text-muted); margin-left: 10px; }

.order-card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
}
.order-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.order-table { font-weight: 700; }
.order-items { font-size: 13px; color: var(--text-secondary); }
.order-items li { padding: 2px 0; }
.order-note { font-style: italic; color: var(--text-muted); padding-left: 16px; font-size: 12px; }
.order-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 13px; }
.order-total { font-weight: 700; }

/* Kiosk mode */
body.kiosk-mode .portal-nav,
body.kiosk-mode .portal-sidebar { display: none; }
body.kiosk-mode .portal-main { margin-left: 0; padding: 24px; max-width: none; }
.kiosk-exit {
  display: none;
  position: fixed; top: 14px; right: 14px; z-index: 60;
}
body.kiosk-mode .kiosk-exit { display: inline-flex; }

/* ── Disponibilidade ───────────────────────────────────── */
.dispo-category {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 8px 0; margin-top: 18px;
}
.dispo-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-bottom: 1px solid var(--border);
  padding: 12px 4px;
  transition: background 150ms ease;
  min-height: 52px;
}
.dispo-row:last-child { border-bottom: none; }
.dispo-row.unavailable { background: rgba(239,68,68,0.03); }
.dispo-row.unavailable .dispo-name { text-decoration: line-through; color: var(--text-secondary); }
.dispo-name { font-size: 14px; }
.dispo-price { font-size: 13px; color: var(--text-muted); margin-left: 8px; }
.dispo-toggle-wrap { display: flex; align-items: center; gap: 10px; }
.dispo-state-label { font-size: 12px; min-width: 70px; text-align: right; }
.dispo-state-label.on { color: var(--success); }
.dispo-state-label.off { color: var(--danger); }

.status-pill-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }

/* ── Alterações ────────────────────────────────────────── */
.char-counter { text-align: right; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.char-counter.over { color: var(--danger); }

.dropzone {
  border: 1.5px dashed var(--border-md);
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted); font-size: 13px;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--border-strong); color: var(--text-secondary); }
.dropzone-preview {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border-md);
  border-radius: 10px; padding: 10px 14px; font-size: 13px;
}
.dropzone-preview img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.dropzone-preview .remove-file {
  margin-left: auto; background: none; border: none;
  color: var(--text-muted); cursor: pointer; padding: 6px;
  border-radius: 6px; transition: color 150ms ease, background 150ms ease;
}
.dropzone-preview .remove-file:hover { color: var(--danger); background: var(--bg-hover); }

.sla-notice {
  background: var(--bg-elevated); border-radius: 10px;
  padding: 12px 16px; font-size: 13px; color: var(--text-secondary);
  margin-top: 16px;
}

.filter-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-tab {
  background: transparent; border: 1px solid var(--border-md);
  color: var(--text-secondary);
  border-radius: 999px; padding: 5px 14px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all 150ms ease;
  min-height: 30px;
}
.filter-tab:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-tab.active { background: var(--accent); color: #000; border-color: var(--accent); }

.request-desc { cursor: pointer; }
.request-desc.expanded { white-space: normal; }

.urgency-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 13px; color: var(--text-secondary); }

/* ── Referências ───────────────────────────────────────── */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.step-card { text-align: center; padding: 24px 18px; }
.step-card svg { margin: 0 auto 12px; color: var(--text-secondary); width: 22px; height: 22px; }
.step-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.step-text { font-size: 12px; color: var(--text-muted); }

.code-card {
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 32px 24px;
  margin-bottom: 24px;
}
.code-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 12px; }
.code-display {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 28px; font-weight: 700; letter-spacing: 0.2em;
  color: #fff; margin-bottom: 20px;
}
.code-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.credits-value { font-size: 28px; font-weight: 700; }
.referred-by-box {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px;
  font-size: 13px; color: var(--text-secondary); margin-top: 14px;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — mobile (bottom tab bar)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .portal-sidebar {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; height: 64px;
    flex-direction: row; gap: 0;
    padding: 0;
    border-right: none; border-top: 1px solid var(--border);
  }
  .sidebar-item {
    flex: 1; flex-direction: column; justify-content: center; gap: 3px;
    font-size: 10px; padding: 6px 2px; border-radius: 0;
    min-height: 64px; min-width: 44px;
  }
  .sidebar-item.active { background: transparent; }
  .sidebar-item span { white-space: nowrap; }

  .portal-main { margin-left: 0; padding: calc(var(--nav-h) + 20px) 16px 96px; }
  .portal-client-name { display: none; }

  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .quick-action { flex: 0 0 auto; min-width: 200px; }
  .steps-grid { grid-template-columns: 1fr; }
  .nexo-toast-container { left: 16px; right: 16px; }
  .nexo-toast { max-width: none; min-width: 0; width: 100%; }

  body.kiosk-mode .portal-sidebar { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════ */
@media print {
  .portal-nav, .portal-sidebar, .kiosk-exit, .nexo-toast-container { display: none !important; }
  .portal-main { margin: 0; padding: 0; }
  body { background: #fff; color: #000; }
}

/* ═══════════════════════════════════════════════════════════
   NOTIFICATIONS (bell + dropdown)
   ═══════════════════════════════════════════════════════════ */
.portal-notifications-btn {
  position: relative; cursor: pointer;
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: color 150ms ease, background 150ms ease;
}
.portal-notifications-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 100px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.portal-notif-dropdown {
  position: absolute; top: 46px; right: 0;
  width: 360px; max-width: calc(100vw - 32px);
  max-height: 70vh; overflow-y: auto;
  background: var(--bg-elevated); border: 1px solid var(--border-md);
  border-radius: 12px; z-index: 1000;
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  cursor: default;
}
.portal-notif-dropdown.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.notif-dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  position: sticky; top: 0; background: var(--bg-elevated); z-index: 1;
}
.notif-mark-all {
  font-size: 11px; color: var(--text-muted); background: none; border: none;
  cursor: pointer; transition: color 150ms ease;
}
.notif-mark-all:hover { color: var(--text-primary); }
.notif-item {
  position: relative; display: flex; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 150ms ease;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(59,130,246,0.04); }
.notif-item.unread::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--info);
}
.notif-icon { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.notif-content { flex: 1; min-width: 0; }
.notif-title {
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-body { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; margin-top: 2px; }
.notif-empty { padding: 32px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ═══════════════════════════════════════════════════════════
   SALA EM DIRECTO
   ═══════════════════════════════════════════════════════════ */
.sala-grid { display: grid; grid-template-columns: 35% 35% 30%; gap: 16px; align-items: start; }
.sala-col { display: flex; flex-direction: column; gap: 14px; }
.sala-col-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600; margin-bottom: 4px;
}
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--bg-elevated); border: 1px solid var(--border-md);
  border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--text-secondary);
}
.order-card.is-new { animation: slide-in-top 350ms ease; border-color: rgba(245,158,11,0.5); }
.order-card.is-seen { opacity: 0.65; }
@keyframes slide-in-top { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.badge--new { background: rgba(245,158,11,0.12); color: var(--warning); border-color: rgba(245,158,11,0.3); animation: pulse-badge 1.6s infinite; }

.activity-feed { display: flex; flex-direction: column; }
.activity-row {
  display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border);
  animation: slide-in-top 300ms ease;
}
.activity-row:last-child { border-bottom: none; }
.activity-icon { font-size: 18px; flex-shrink: 0; }
.activity-content { flex: 1; min-width: 0; }
.activity-title { font-size: 13px; color: var(--text-primary); }
.activity-desc { font-size: 12px; color: var(--text-secondary); }
.activity-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

.sala-stats-bar {
  position: sticky; bottom: 0; margin-top: 20px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px;
  display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary);
}
.sala-stats-bar strong { color: var(--text-primary); font-weight: 700; }

.sala-tabs { display: none; }
@media (max-width: 1024px) {
  .sala-grid { grid-template-columns: 1fr; }
  .sala-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
  .sala-col[hidden] { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   ESTATÍSTICAS
   ═══════════════════════════════════════════════════════════ */
.range-tabs { display: flex; gap: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-box { position: relative; height: 280px; }
.chart-box canvas { max-height: 280px; }
.roi-banner {
  background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(59,130,246,0.06));
  border: 1px solid var(--border-md); border-radius: 14px;
  padding: 24px; margin-bottom: 24px;
}
.roi-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--success); }
.roi-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.funnel-step { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.funnel-step:last-child { border-bottom: none; }
.funnel-bar { height: 6px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; flex: 1; margin: 0 12px; }
.funnel-fill { height: 100%; background: var(--info); border-radius: 999px; }
.ai-report { white-space: pre-wrap; line-height: 1.7; font-size: 14px; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════
   SETTINGS ROWS (portal — usado na Fila de Espera)
   ═══════════════════════════════════════════════════════════ */
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row .label { font-size: 14px; }
.settings-row .hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
select.input { appearance: none; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   Live activity strip (dashboard)
   ═══════════════════════════════════════════════════════════ */
.live-strip { display: flex; flex-direction: column; }

@media (max-width: 768px) {
  /* 10 nav items → horizontal scroll on the bottom bar */
  .portal-sidebar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .sidebar-item { flex: 0 0 auto; min-width: 68px; }
  .two-col { grid-template-columns: 1fr; }
  .portal-notif-dropdown { position: fixed; top: var(--nav-h); right: 8px; left: 8px; width: auto; max-width: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ═══════════════════════════════════════════════════════════
   AWWWARDS POLISH LAYER (v2)
   Eleva profundidade, movimento e detalhe — sem mexer em classes
   nem lógica. Mantém a filosofia dark/minimal, só mais refinada.
   ═══════════════════════════════════════════════════════════ */
:root {
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow-md: 0 10px 30px -14px rgba(0,0,0,.7);
  --shadow-lg: 0 24px 60px -24px rgba(0,0,0,.85);
}

/* Profundidade ambiente subtil (não interfere com cliques) */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 82% -12%, rgba(255,255,255,.040), transparent 60%),
    radial-gradient(820px 480px at -8% 112%, color-mix(in srgb, var(--brand, #3B82F6) 9%, transparent), transparent 60%);
}

/* Tipografia mais afinada + números tabulares */
.page-title { letter-spacing: -.03em; }
.card-title { letter-spacing: -.01em; }
.table td, .rnv-value, .rnv-stat .n, .stat-num, .metric-value { font-variant-numeric: tabular-nums; }

/* Cartões: profundidade + realce no hover (sem salto que distraia) */
.card {
  box-shadow: var(--shadow-sm);
  transition: border-color 220ms var(--ease), box-shadow 220ms var(--ease), transform 220ms var(--ease);
}
.card:hover { border-color: var(--border-md); box-shadow: var(--shadow-md); }

/* Botões: micro-feedback mais polido */
.btn { transition: background 180ms var(--ease), border-color 180ms var(--ease), transform 120ms var(--ease), box-shadow 180ms var(--ease); }
.btn-primary { box-shadow: 0 2px 14px -6px rgba(255,255,255,.35); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 20px -6px rgba(255,255,255,.45); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }

/* Inputs: anel de foco suave */
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}

/* Sidebar: item ativo com leve relevo */
.sidebar-item.active { box-shadow: inset 0 0 0 1px var(--border); }

/* Sobreposições com profundidade real */
.portal-dropdown, .portal-notif-dropdown { box-shadow: var(--shadow-lg); }
.modal { box-shadow: var(--shadow-lg); }
.nexo-toast { box-shadow: var(--shadow-md); backdrop-filter: blur(6px); }

/* Barra de progresso (onboarding/renovação): brilho subtil + transição */
.progress-fill, .rnv-ring .fill { transition: width 900ms var(--ease); }
.progress-fill {
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--brand, #3B82F6) 70%, var(--text-primary)), var(--text-primary));
}

/* Avatar/logo com transição mais fluida */
.portal-avatar { transition: border-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease); }
.portal-avatar:hover { transform: scale(1.05); }

/* Linhas de tabela com realce mais nítido */
.table tbody tr:hover { background: rgba(255,255,255,.025); }

/* Respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .card:hover { transform: none; }
}

/* ═══ REDESIGN v2 — componentes partilhados (KPIs, headers, estados) ═══ */

/* Cabeçalho de página com "eyebrow" e título maior */
.page-title { font-size: 26px; }
.page-header { position: relative; }
.page-header::before {
  content: ''; position: absolute; left: -28px; top: 2px; bottom: 2px;
  width: 3px; border-radius: 3px;
  background: linear-gradient(var(--brand, var(--text-primary)), transparent);
  opacity: .55;
}
@media (max-width: 900px) { .page-header::before { display: none; } }

/* KPIs / metric tiles — mais premium */
.metric-card { min-height: 132px; justify-content: space-between; transition: border-color 220ms var(--ease), box-shadow 220ms var(--ease), transform 220ms var(--ease); }
.metric-card:hover { transform: translateY(-2px); border-color: var(--border-md); box-shadow: var(--shadow-md); }
.metric-head svg {
  width: 34px; height: 34px; padding: 8px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--text-secondary); transition: color 200ms var(--ease), background 200ms var(--ease);
}
.metric-card:hover .metric-head svg { color: var(--text-primary); background: rgba(255,255,255,.07); }
.metric-value { font-size: clamp(24px, 3.4vw, 30px); font-weight: 800; letter-spacing: -.03em; }

/* Empty states com ícone em círculo suave */
.empty-state { padding: 40px 20px; }
.empty-state svg {
  width: 22px; height: 22px; margin-bottom: 12px; color: var(--text-secondary);
  box-sizing: content-box; padding: 13px; border-radius: 50%;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
}
.empty-title { font-size: 14px; color: var(--text-primary); }

/* Filtros tipo "segmented" */
.filter-tabs { gap: 4px; padding: 4px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; width: fit-content; }
.filter-tab { border-color: transparent !important; background: transparent; transition: background 160ms var(--ease), color 160ms var(--ease); }
.filter-tab:hover { background: rgba(255,255,255,.04); }
.filter-tab.active { background: var(--bg-surface); color: var(--text-primary); border-color: transparent !important; box-shadow: var(--shadow-sm); }

/* Badges com leve profundidade */
.badge { box-shadow: var(--shadow-sm); }
.badge--muted { box-shadow: none; }

/* card-title com mais presença */
.card-title { font-size: 14px; font-weight: 700; }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD — layout premium (big-business SaaS)
   ═══════════════════════════════════════════════════════════ */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .kpi-row { grid-template-columns: 1fr; } }

.kpi { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 16px;
  transition: border-color 220ms var(--ease), box-shadow 220ms var(--ease), transform 220ms var(--ease); }
.kpi:hover { transform: translateY(-2px); border-color: var(--border-md); box-shadow: var(--shadow-md); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.kpi-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--text-secondary);
  transition: color 200ms var(--ease), background 200ms var(--ease); }
.kpi:hover .kpi-ico { color: var(--text-primary); background: rgba(255,255,255,.07); }
.kpi-num { font-size: 40px; font-weight: 800; letter-spacing: -.045em; line-height: .95; font-variant-numeric: tabular-nums; }
.kpi-num .u { font-size: 14px; font-weight: 600; letter-spacing: -.01em; color: var(--text-secondary); margin-left: 6px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.kpi-foot .s { font-size: 12px; color: var(--text-secondary); }
.kpi-link { font-size: 12px; color: var(--text-muted); white-space: nowrap; transition: color 150ms var(--ease); }
.kpi:hover .kpi-link { color: var(--text-primary); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 18px; align-items: start; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--nav-h) + 20px); }
@media (max-width: 980px) { .dash-aside { position: static; } }

.dash-section-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 12px; }

.status-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.status-row:last-child { border-bottom: none; padding-bottom: 0; }
.status-row:first-child { padding-top: 0; }
.status-k { color: var(--text-secondary); }
.status-v { font-weight: 600; text-align: right; }

.qa-list { display: grid; gap: 8px; }
.qa { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease); }
.qa:hover { border-color: var(--border-md); background: var(--bg-hover); transform: translateX(3px); }
.qa svg { width: 16px; height: 16px; opacity: .75; flex-shrink: 0; }
.qa .qa-arrow { margin-left: auto; opacity: .5; }

/* ═══════════════════════════════════════════════════════════
   MODO RESTAURANTE (Sala) — ecrã always-on
   ═══════════════════════════════════════════════════════════ */
.resto-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.resto-eyebrow { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.resto-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.resto-clock { font-size: 14px; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.resto-sep { color: var(--text-muted); }

/* Faixa de KPIs no topo — glanceable */
.resto-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 1024px) { .resto-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .resto-stats { grid-template-columns: repeat(2, 1fr); } }
.resto-stat {
  display: flex; align-items: center; gap: 11px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 14px; box-shadow: var(--shadow-sm);
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.resto-stat:hover { border-color: var(--border-md); box-shadow: var(--shadow-md); }
.resto-stat .rs-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--text-secondary); flex-shrink: 0; }
.resto-stat .rs-ico svg { width: 16px; height: 16px; }
.resto-stat .rs-v { font-size: 20px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.resto-stat .rs-l { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-top: 2px; }

/* Colunas como painéis */
.sala-grid .sala-col.card { padding: 18px; }
.sala-col-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }

/* Kiosk: tudo maior e mais legível à distância */
body.kiosk-mode .resto-eyebrow { font-size: 26px; }
body.kiosk-mode .resto-stat .rs-v { font-size: 24px; }
body.kiosk-mode .call-table { font-size: 22px; }
body.kiosk-mode .order-table { font-size: 18px; }
body.kiosk-mode .sala-grid { grid-template-columns: 36% 36% 28%; gap: 20px; }

/* ═══ ESTATÍSTICAS — hero honesto (faturação real + contexto) ═══ */
.stat-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; padding: 22px 24px; }
.stat-hero-num { font-size: clamp(34px, 6vw, 48px); font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: 6px;
  background: linear-gradient(120deg, var(--text-primary), color-mix(in srgb, var(--success) 65%, var(--text-primary)));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-hero .rs-l { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.stat-hero-side { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-hero-side .shs { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; min-width: 92px; text-align: center; }
.stat-hero-side .shs-v { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-hero-side .shs-k { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════
   THEME TOGGLE + LIGHT MODE (token-driven, AA contrast)
   ═══════════════════════════════════════════════════════════ */
.portal-icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-elevated); border: 1px solid var(--border-md);
  color: var(--text-secondary); cursor: pointer;
  transition: color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}
.portal-icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); transform: scale(1.06); }
.portal-icon-btn:active { transform: scale(.94); }

/* ── LIGHT THEME ─────────────────────────────────────────── */
html[data-theme="light"] {
  --bg-base: #F6F7F9;
  --bg-surface: #FFFFFF;
  --bg-elevated: #EFF1F4;
  --bg-hover: #E8EBEF;
  --border: rgba(15,18,25,0.10);
  --border-md: rgba(15,18,25,0.16);
  --border-strong: rgba(15,18,25,0.30);
  --text-primary: #14161A;
  --text-secondary: #545A66;
  --text-muted: #868D99;
  --accent: #14161A;
  --success: #15803D;
  --warning: #B45309;
  --danger: #DC2626;
  --info: #2563EB;
  --shadow-sm: 0 1px 2px rgba(15,18,25,.06);
  --shadow-md: 0 10px 30px -14px rgba(15,18,25,.18);
  --shadow-lg: 0 24px 60px -24px rgba(15,18,25,.26);
}
/* Botão primário: accent escuro → texto branco */
html[data-theme="light"] .btn-primary { color: #fff; box-shadow: 0 2px 14px -7px rgba(15,18,25,.4); }
html[data-theme="light"] .btn-primary:hover:not(:disabled) { background: #2B2F36; }
html[data-theme="light"] .btn-primary:active:not(:disabled) { background: #3A3F47; }
/* Filtro segmented ativo */
html[data-theme="light"] .filter-tab.active { color: var(--text-primary); }

/* Glow ambiente em versão clara */
html[data-theme="light"] body::before {
  background:
    radial-gradient(1100px 620px at 82% -12%, rgba(15,18,25,.035), transparent 60%),
    radial-gradient(820px 480px at -8% 112%, color-mix(in srgb, var(--brand, #2563EB) 10%, transparent), transparent 60%);
}

/* Tints brancos → tints escuros (chips de ícone, hovers, foco) */
html[data-theme="light"] .metric-head svg,
html[data-theme="light"] .kpi-ico,
html[data-theme="light"] .resto-stat .rs-ico,
html[data-theme="light"] .empty-state svg { background: rgba(15,18,25,.045); }
html[data-theme="light"] .metric-card:hover .metric-head svg,
html[data-theme="light"] .kpi:hover .kpi-ico { background: rgba(15,18,25,.075); }
html[data-theme="light"] .filter-tab:hover,
html[data-theme="light"] .table tbody tr:hover,
html[data-theme="light"] .qa:hover,
html[data-theme="light"] .item-row:hover { background: rgba(15,18,25,.035); }
html[data-theme="light"] .card:hover { background: var(--bg-surface); }
html[data-theme="light"] .input:focus,
html[data-theme="light"] .select:focus,
html[data-theme="light"] .textarea:focus { box-shadow: 0 0 0 3px rgba(15,18,25,.07); }
html[data-theme="light"] .nexo-toast { backdrop-filter: none; }

/* Scrollbar clara */
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15,18,25,.18); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(15,18,25,.28); }
html[data-theme="light"] * { scrollbar-color: rgba(15,18,25,.18) transparent; }

/* Transição suave ao trocar de tema */
.portal-nav, .portal-sidebar, .card, .btn, .input, .select, .textarea, .badge,
.kpi, .resto-stat, .qa, .portal-icon-btn, .portal-avatar {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 240ms; transition-timing-function: var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .portal-nav, .portal-sidebar, .card, .btn, .input, .select, .textarea, .badge,
  .kpi, .resto-stat, .qa, .portal-icon-btn, .portal-avatar { transition-duration: .001ms; }
}

/* ═══════════════════════════════════════════════════════════
   PREMIUM v3 — mais presença (sem perder UX)
   ═══════════════════════════════════════════════════════════ */
/* Cartões "iluminados de cima": hairline highlight no topo */
.card { box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.045); }
.card:hover { box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.06); }
html[data-theme="light"] .card { box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.7); }
html[data-theme="light"] .card:hover { box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.9); }

/* Tipografia com mais carácter */
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.035em; }
.resto-eyebrow { font-size: 24px; }

/* Navegação: barra superior e logo mais nítidos */
.portal-nav { backdrop-filter: blur(10px); background: color-mix(in srgb, var(--bg-base) 86%, transparent); }
.portal-logo { font-size: 17px; letter-spacing: -.03em; }

/* Sidebar: item ativo com acento da marca mais presente */
.sidebar-item.active {
  background: color-mix(in srgb, var(--brand, var(--text-primary)) 9%, var(--bg-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand, #ffffff) 16%, transparent);
}
body.has-brand .sidebar-item.active::before { width: 3px; box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 60%, transparent); }

/* Botão primário com leve profundidade de gradiente */
.btn-primary { background-image: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0)); }
html[data-theme="light"] .btn-primary { background-image: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0)); }

/* KPIs: número com leve degradê (só os neutros — preserva cores semânticas) */
.kpi-num:not(.text-success):not(.text-info):not(.text-danger):not(.text-warning),
.resto-stat .rs-v:not(.text-success):not(.text-info):not(.text-danger):not(.text-warning) {
  background: linear-gradient(180deg, var(--text-primary), color-mix(in srgb, var(--text-primary) 78%, var(--text-secondary)));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* Remoção de atraso de toque em todos os botões/ações */
.btn, .sidebar-item, .qa, .filter-tab, .portal-icon-btn, [data-seen], [data-resolve], [data-notify], [data-seat] { touch-action: manipulation; }

/* ═══════════════════════════════════════════════════════════
   MODO RESTAURANTE — KIOSK / TOUCH (tablet de parede/balcão)
   ═══════════════════════════════════════════════════════════ */
/* Alvos de toque generosos + tipografia legível à distância */
body.kiosk-mode .btn { height: 54px; padding: 0 24px; font-size: 15px; border-radius: 14px; }
body.kiosk-mode .btn-sm { height: 48px; padding: 0 20px; font-size: 14px; border-radius: 12px; }
body.kiosk-mode .kiosk-exit { height: 48px; padding: 0 20px; font-size: 15px; top: 18px; right: 18px; z-index: 70; }
/* Em ecrã completo já existe o botão "Sair" fixo — esconder o "Ecrã completo" do cabeçalho (evita sobreposição) */
body.kiosk-mode #kiosk-toggle { display: none; }
body.kiosk-mode .resto-stat { padding: 16px 18px; }
body.kiosk-mode .resto-stat .rs-v { font-size: 26px; }
body.kiosk-mode .resto-stat .rs-l { font-size: 12px; }
body.kiosk-mode .sala-col.card { padding: 22px; }
body.kiosk-mode .sala-col-title { font-size: 15px; }
body.kiosk-mode .call-card { padding: 18px 22px; }
body.kiosk-mode .call-table { font-size: 22px; }
body.kiosk-mode .order-card { padding: 18px 20px; }
body.kiosk-mode .order-items { font-size: 15px; }
body.kiosk-mode .activity-title { font-size: 15px; }
body.kiosk-mode .count-badge { min-width: 26px; height: 26px; font-size: 13px; }

/* Ações da Sala sempre confortáveis ao toque (mesmo fora do kiosk) */
.call-card .btn, .order-foot .btn, #waitlist-list .btn { min-height: 44px; }
body.kiosk-mode .call-card .btn, body.kiosk-mode .order-foot .btn, body.kiosk-mode #waitlist-list .btn { min-height: 52px; min-width: 130px; }

/* Decomposição da faturação (Estatísticas) */
.stat-hero-break { font-size: 12.5px; color: var(--text-secondary); margin-top: 8px; }
.stat-hero-break strong { color: var(--text-primary); font-weight: 700; }
.stat-hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.stat-hero-chips .shc {
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════
   FREE FEATURES — Briefing / Previsão / Matriz / Heatmap
   ═══════════════════════════════════════════════════ */

/* ── Briefing diário ── */
.brief-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.brief-hello { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.brief-date { font-size: 13px; color: var(--text-muted); }
.brief-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; padding: 16px 20px; border-top: 1px solid var(--border); }
.brief-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.brief-row .br-ico { width: 18px; text-align: center; }
.brief-row .br-lbl { color: var(--text-secondary); }
.brief-row .br-val { margin-left: auto; color: var(--text-primary); font-weight: 500; font-variant-numeric: tabular-nums; }
.brief-att { display: flex; flex-direction: column; gap: 8px; }
.brief-att a { font-size: 13px; display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); text-decoration: none; }
.brief-att a:hover { color: var(--text-primary); }
.brief-allclear { display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--success); height: 100%; min-height: 60px; }
.brief-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.brief-tip { font-size: 12px; color: var(--text-muted); }
.brief-close { background: none; border: none; cursor: pointer; font-size: 11px; color: var(--text-muted); padding: 4px; }
.brief-close:hover { color: var(--text-secondary); }

/* ── Previsão de receita ── */
.fc-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.fc-day { width: 92px; flex-shrink: 0; font-size: 12px; color: var(--text-secondary); }
.fc-track { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-elevated); overflow: hidden; }
.fc-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.fc-val { width: 64px; flex-shrink: 0; text-align: right; font-size: 12px; font-weight: 500; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.fc-lvl { flex-shrink: 0; font-size: 9px; font-weight: 600; border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.fc-lvl--high { background: rgba(239,68,68,0.1); color: var(--danger); }
.fc-lvl--medium { color: var(--text-muted); }
.fc-lvl--low { background: rgba(59,130,246,0.1); color: var(--info); }

/* ── Matriz do menu ── */
.mtx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.mtx-cell { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.mtx-cell--star { border-color: rgba(34,197,94,0.2); }
.mtx-cell--puzzle { border-color: rgba(59,130,246,0.2); }
.mtx-cell--workhorse { border-color: rgba(245,158,11,0.2); }
.mtx-cell--dog { border-color: var(--border); }
.mtx-cell-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mtx-lbl { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.mtx-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.mtx-count { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.mtx-items { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.mtx-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; position: relative; }
.mtx-item .mi-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.mtx-item .mi-name { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtx-item .mi-views { margin-left: auto; font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.mtx-item .mi-tip { display: none; position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 5;
  background: var(--bg-elevated); border: 1px solid var(--border-md); border-radius: 8px; padding: 6px 10px;
  font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.mtx-item:hover .mi-tip { display: block; }
.mtx-hint { font-size: 11px; color: var(--text-muted); margin-top: 10px; }
.mtx-more { font-size: 11px; color: var(--text-secondary); background: none; border: none; cursor: pointer; padding: 4px 0; }
.mtx-empty { position: relative; }
.mtx-empty .mtx-grid { opacity: .3; pointer-events: none; }
.mtx-empty-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 13px; color: var(--text-secondary); padding: 20px; }

/* ── Heatmap da carta ── */
.heat-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.heat-pill { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 8px;
  font-size: 13px; min-height: 38px; border: 1px solid transparent; cursor: default; transition: border-color .15s ease; }
.heat-pill:hover { border-color: var(--border-md); }
.heat-pill .hp-n { font-size: 11px; color: var(--text-muted); }
.heat-warn { display: flex; gap: 8px; background: rgba(245,158,11,0.05); border: 1px solid rgba(245,158,11,0.2);
  border-radius: 12px; padding: 12px 14px; margin-top: 16px; font-size: 13px; color: var(--text-secondary); }

@media (max-width: 768px) {
  .brief-body { grid-template-columns: 1fr; }
  .mtx-grid { grid-template-columns: 1fr; }
  .heat-pill { min-height: 44px; }
}

/* ── Dashboard: Atalhos operacionais (Phase 9.2) ───────────────── */
.ops-launch-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 720px) { .ops-launch-grid { grid-template-columns: repeat(2, 1fr); } }
.ops-launch {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 96px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 14px; text-decoration: none; cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.ops-launch:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.ops-launch:active { transform: scale(0.98); }
.ops-ico { font-size: 28px; line-height: 1; }
.ops-lbl { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-weight: 600; }
.ops-badge {
  position: absolute; top: 8px; right: 8px;
  font-family: 'Azeret Mono', ui-monospace, monospace;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 100px;
  display: inline-flex; align-items: center; gap: 3px;
}
.ops-badge--warning { background: rgba(245,158,11,0.14); color: var(--warning); }
.ops-badge--success { background: rgba(34,197,94,0.14); color: var(--success); }
