@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Design tokens ── */
:root {
  --primary: #0880C8;
  --primary-hover: #0668a0;
  --primary-light: #e0f2fe;
  --primary-ghost: rgba(8,128,200,0.08);

  --sidebar-bg: #111827;
  --sidebar-text: #9ca3af;
  --sidebar-active: #0880C8;
  --sidebar-hover: #1f2937;
  --sidebar-width: 240px;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-focus: #0880C8;

  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #0880C8;
  --info-bg: #e0f2fe;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);

  --transition: 150ms ease;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { cursor: pointer; font-family: inherit; }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
}

/* ── Layout ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand h1 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.sidebar-brand small {
  font-size: 11px;
  color: var(--sidebar-text);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text);
  padding: 12px 12px 6px;
  opacity: 0.6;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #e5e7eb;
  text-decoration: none;
}

.nav-item.active {
  background: rgba(8,128,200,0.15);
  color: var(--sidebar-active);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--sidebar-text);
}

.sidebar-user:hover {
  background: var(--sidebar-hover);
}

.user-switch-icon {
  transition: transform var(--transition);
}

.user-switch-icon.open {
  transform: rotate(180deg);
}

.user-dropdown {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  margin: 4px 0 8px;
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--sidebar-text);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 13px;
  font-family: inherit;
  transition: background var(--transition);
}

.user-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
}

.user-dropdown-item.active {
  color: var(--sidebar-active);
}

.user-dropdown-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(8,128,200,0.2);
  color: var(--sidebar-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-dropdown-item.active .user-dropdown-avatar {
  background: var(--primary);
  color: #fff;
}

.user-dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 0;
}

/* ── Main content ── */
.main-content {
  flex: 1;
  min-width: 0; /* não deixa conteúdo largo empurrar a página para fora da tela */
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-content {
  padding: 24px;
  max-width: 1200px;
}

/* ── Login ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
}

.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 32px;
}

.login-notice {
  background: var(--warning-bg);
  border: 1px solid #fcd34d;
  color: #92400e;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  text-align: center;
  margin: -16px 0 20px;
}

/* ── Sessão expirada ── */
.session-expired {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
}

.session-expired-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
  text-align: center;
}

.session-expired-card .se-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--warning-bg);
  display: grid;
  place-items: center;
}

.session-expired-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.session-expired-card .btn {
  justify-content: center;
  text-decoration: none;
}

.session-expired-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 22px;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

/* ── Stat cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-card .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-card .sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: var(--primary-ghost); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-alt); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 8px;
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-icon {
  padding: 6px;
  border-radius: var(--radius-sm);
}

/* ── Forms ── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.form-group label .required {
  color: var(--danger);
}

.form-control.field-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(239,68,68,.15);
}

.field-error-msg {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.field-error-msg::before {
  content: '*';
  font-weight: 700;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(8,128,200,0.12);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Badges ── */
.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-contact {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.site-contact:last-child { border-bottom: 0; }
.site-contact.unread { background: var(--primary-ghost); }
.site-contact-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.site-contact-head strong { font-size: 15px; }
.site-contact-meta { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.site-contact-msg { margin-top: 10px; white-space: pre-line; line-height: 1.55; font-size: 14px; }
.site-contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--surface-alt); color: var(--text-secondary); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 200ms;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(10px);
  transition: transform 200ms;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 18px;
}

.modal-close:hover { background: var(--surface-alt); }

.modal-body { padding: 20px 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  animation: toastIn 300ms ease;
}

.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-info { background: var(--primary); color: #fff; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── Misc ── */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 12px; }
.text-mono { font-variant-numeric: tabular-nums; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
}

.page-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.client-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-alt);
}

.client-logo-placeholder {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--text-muted); }

.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--primary-ghost) !important; }

/* ── Confirm dialog ── */
.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ── Install steps (printer guide) ── */
.install-step {
  position: relative;
  padding: 20px 24px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.install-step h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
}

.install-step p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}

.install-step ol, .install-step ul {
  font-size: 13.5px;
}

.install-step code {
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  border: 1px solid var(--border);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-tip {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--primary-light);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Responsive ── */
.mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px;
  margin-left: -8px;
  cursor: pointer;
}
.mobile-toggle:hover { background: var(--surface-alt); }

.sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 12px;
  z-index: 1;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.5);
}

.main-content { transition: margin-left var(--transition); }

/* Computador: menu recolhido pelo botão ☰ */
@media (min-width: 769px) {
  body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
  body.sidebar-collapsed .main-content { margin-left: 0; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: min(280px, 85vw);
    box-shadow: 0 0 40px rgba(0,0,0,0.35);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.open ~ .sidebar-backdrop {
    display: block;
  }

  .sidebar-close {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

/* ── Notification bell & panel ── */

.notif-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}
.notif-bell:hover {
  background: var(--primary-ghost);
  color: var(--primary);
}
.notif-badge {
  position: absolute;
  top: 0;
  right: -2px;
  background: var(--danger, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  overflow: hidden;
  z-index: 200;
}
@media (max-width: 720px) {
  .notif-panel {
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 80px);
  }
  .notif-panel-body { max-height: calc(100vh - 150px); }
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}
.notif-panel-body {
  overflow-y: auto;
  max-height: 380px;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-alt); }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #cce5f7; }
.notif-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.notif-icon.new_store { background: #dbeafe; }
.notif-icon.new_subscription { background: #ede9fe; }
.notif-icon.store_activated { background: #dcfce7; }
.notif-icon.payment_received { background: #fef9c3; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-msg { font-size: 12px; color: var(--text-secondary); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

@media (max-width: 480px) {
  .notif-panel { width: calc(100vw - 24px); right: -8px; }
}

/* ── Combo category filter ── */
.combo-cat-filter {
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-secondary);
  transition: all 0.15s;
}
.combo-cat-filter:hover { border-color: var(--primary); color: var(--primary); }
.combo-cat-filter.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Toggle de disponibilidade ── */
.avail-switch { position:relative; display:inline-block; width:36px; height:20px; cursor:pointer; margin:0; }
.avail-switch input { opacity:0; width:0; height:0; }
.avail-slider { position:absolute; inset:0; background:#ccc; border-radius:20px; transition:.2s; }
.avail-slider::before { content:''; position:absolute; width:16px; height:16px; left:2px; bottom:2px; background:#fff; border-radius:50%; transition:.2s; }
.avail-switch input:checked + .avail-slider { background:var(--success, #22c55e); }
.avail-switch input:checked + .avail-slider::before { transform:translateX(16px); }

/* ── KDS (Kitchen Display System) ── */
.kds-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.kds-filters { display:flex; gap:6px; flex-wrap:wrap; }
.kds-toolbar-right { display:flex; gap:6px; }
.kds-filter { padding:6px 14px; font-size:13px; font-weight:500; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text-secondary); cursor:pointer; transition:all .15s; }
.kds-filter:hover { border-color:var(--primary); color:var(--primary); }
.kds-filter.active { background:var(--primary); color:#fff; border-color:var(--primary); }

.kds-board { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; align-items:start; }
@media (max-width:1200px) { .kds-board { grid-template-columns:repeat(2,1fr); } }
@media (max-width:640px) { .kds-board { grid-template-columns:1fr; } }
.kds-flat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:12px; padding:0 4px; }
@media (max-width:640px) { .kds-flat-grid { grid-template-columns:1fr; } }

.kds-col { background:var(--surface-alt, #f8fafc); border-radius:12px; min-height:200px; }
.kds-col-header { display:flex; align-items:center; gap:8px; padding:12px 14px; font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; border-top:3px solid; border-radius:12px 12px 0 0; color:var(--text-primary); }
.kds-col-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.kds-col-count { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:0 7px; font-size:12px; font-weight:600; margin-left:auto; }
.kds-col-body { padding:8px; display:flex; flex-direction:column; gap:8px; }
.kds-empty { text-align:center; padding:24px 8px; color:var(--text-muted); font-size:13px; }

.kds-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:12px; transition:box-shadow .15s; }
.kds-card:hover { box-shadow:0 2px 8px rgba(0,0,0,.08); }
.kds-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.kds-card-id { font-size:14px; font-weight:700; color:var(--text-primary); }
.kds-card-timer { font-size:13px; font-weight:700; }
.kds-card-customer { margin-bottom:6px; font-size:13px; }
.kds-card-customer strong { display:block; color:var(--text-primary); }
.kds-card-phone { font-size:12px; color:var(--text-muted); }
.kds-card-delivery { font-size:12px; color:var(--text-secondary); margin-bottom:8px; }
.kds-card-items { border-top:1px solid var(--border); padding-top:8px; margin-bottom:8px; }
.kds-item-line { font-size:12px; color:var(--text-primary); padding:2px 0; line-height:1.4; }
.kds-card-notes { font-size:11px; color:var(--warning, #f59e0b); background:rgba(245,158,11,.08); padding:6px 8px; border-radius:6px; margin-bottom:8px; }
.kds-card-footer { display:flex; align-items:center; justify-content:space-between; border-top:1px solid var(--border); padding-top:8px; }
.kds-card-total { font-size:14px; font-weight:700; color:var(--text-primary); }
.kds-card-actions { display:flex; gap:6px; }
.kds-btn { padding:5px 12px; font-size:12px; font-weight:600; border-radius:6px; cursor:pointer; transition:opacity .15s; }
.kds-btn:hover { opacity:.85; }
.kds-btn-next { color:#fff; }
.kds-btn-cancel { background:rgba(239,68,68,.1); color:#ef4444; }

/* ── Reservas (Pesqueiro) ── */
.rva-link { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rva-link a { color: var(--primary); font-weight: 600; word-break: break-all; }
.rva-block { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; background: var(--surface); }
.rva-block h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.rva-empty { border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
.rva-map { position: relative; border-radius: var(--radius); overflow: hidden; background: #dfe7df; cursor: crosshair; user-select: none; touch-action: none; }
.rva-map img { display: block; width: 100%; height: auto; pointer-events: none; }
.rvo-map { cursor: default; margin-bottom: 8px; }
.rva-pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); cursor: grab; background: none; border: 0; padding: 0; }
.rva-pin b { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--primary); border: 2px solid #fff; white-space: nowrap; }
.rva-pin i { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--primary); margin-top: -1px; }
.rva-pin.sel b { background: #f59e0b; transform: scale(1.15); } .rva-pin.sel i { border-top-color: #f59e0b; }
.rva-pin.off b { background: #9ca3af; } .rva-pin.off i { border-top-color: #9ca3af; }
.rva-pin.st-free b { background: #16a34a; } .rva-pin.st-free i { border-top-color: #16a34a; }
.rva-pin.st-pending b { background: #f59e0b; } .rva-pin.st-pending i { border-top-color: #f59e0b; }
.rva-pin.st-confirmed b { background: #dc2626; } .rva-pin.st-confirmed i { border-top-color: #dc2626; }
.rvo-map .rva-pin { cursor: default; }
.rva-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rva-table th { text-align: left; font-size: 12px; color: var(--text-muted); font-weight: 600; padding: 6px 6px; border-bottom: 1px solid var(--border); }
.rva-table td { padding: 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rva-table tr.sel td { background: #fffbeb; }
.rva-table .form-control { padding: 6px 8px; font-size: 13px; }
.rva-radio { display: grid; gap: 8px; margin: 8px 0 12px; font-size: 14px; }
.rva-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.rva-tanks { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.rva-tanks button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; font-weight: 700; font-size: 14px; color: var(--text); text-align: left; }
.rva-tanks button small { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.rva-tanks button.on { border-color: var(--primary); background: var(--primary-light, #eff6ff); box-shadow: inset 0 0 0 1px var(--primary); }
.rva-tanks button.add { border-style: dashed; color: var(--primary); justify-content: center; }
.rva-tank { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface-alt, #f8fafc); }
.rva-tank-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 4px; }
.rva-h4 { font-size: 14px; font-weight: 700; margin: 18px 0 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.rva-fish { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.rva-fish-img { width: 52px; height: 52px; border-radius: 10px; border: 1px dashed var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; overflow: hidden; font-size: 18px; }
.rva-fish-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) { .rva-fish { grid-template-columns: 52px minmax(0, 1fr) 36px; } .rva-fish input:nth-of-type(2) { grid-column: 2 / 4; grid-row: 2; } .rva-fish > button { grid-column: 3; grid-row: 1; } .rva-fish-img { grid-row: 1 / 3; } .rva-tank { padding: 12px; } }
.rva-srule { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-top: 10px; background: var(--surface-alt); }
.rva-srule-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.rva-rule { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 10px; margin: 6px 0; border-radius: 10px; background: var(--surface); border: 1px dashed var(--border); }
.rva-rule-f { display: flex; flex-direction: column; gap: 4px; width: 170px; }
.rva-rule-f label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.rva-wdays-sm { max-width: 340px; flex: 1 1 280px; }
.rva-wdays-sm button { padding: 6px 0; }
.rva-wdays-sm button.on { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.rva-save-status { font-size: 12px; font-weight: 600; margin-left: 8px; color: var(--text-muted); }
.rva-save-status.ok { color: var(--success); }
.rva-save-status.error { color: var(--danger); }
.rva-sub { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-top: 8px; }
.rva-wdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 520px; }
.rva-wdays button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; min-width: 0; font: inherit; color: var(--text); }
.rva-wdays button b { font-size: 14px; }
.rva-wdays button small { font-size: 10px; color: var(--success, #16a34a); font-weight: 600; }
.rva-wdays button:hover { border-color: var(--text-muted); }
.rva-wdays button.off { background: var(--danger-bg, #fde8e8); border-color: var(--danger, #dc2626); color: var(--danger, #dc2626); }
.rva-wdays button.off b { text-decoration: line-through; }
.rva-wdays button.off small { color: var(--danger, #dc2626); }
@media (max-width: 480px) { .rva-wdays { gap: 4px; } .rva-wdays button { padding: 10px 0; } .rva-wdays button small { display: none; } }
.rva-blocked { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rva-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 20px; padding: 4px 6px 4px 12px; font-size: 12px; }
.rva-chip button { border: 0; background: none; cursor: pointer; color: var(--text-muted); padding: 0 4px; }
.rva-pixbox { display: flex; gap: 16px; align-items: flex-start; margin-top: 12px; flex-wrap: wrap; }
.rva-pixbox > div:last-child { flex: 1; min-width: 220px; }
.rva-qr { width: 170px; background: #fff; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); }
.rva-qr svg { display: block; width: 100%; height: auto; }
.rva-save { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }
.rvo-deadline { font-size: 12.5px; margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--warning-bg, #fffbeb); color: #92400e; }
.rvo-deadline.urgent { background: var(--danger-bg); color: var(--danger); }
.rvo-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .rvo-grid { grid-template-columns: minmax(0, 1fr); } .rva-table { display: block; overflow-x: auto; } }
.rvo-cal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rvo-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.rvo-wd { font-size: 11px; color: var(--text-muted); text-align: center; font-weight: 600; padding: 2px 0; }
.rvo-day { aspect-ratio: 1; min-width: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; font-weight: 600; position: relative; }
.rvo-day.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.rvo-day.today span { color: var(--primary); }
.rvo-day.blk { background: var(--surface-alt); color: var(--text-muted); text-decoration: line-through; }
.rvo-day em { font-style: normal; font-size: 10px; font-weight: 700; color: #fff; border-radius: 8px; padding: 0 5px; line-height: 15px; }
.rvo-day em.c { background: #16a34a; } .rvo-day em.p { background: #f59e0b; }
.rvo-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-muted); }
.rvo-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; background: #9ca3af; }
.rvo-legend .free::before { background: #16a34a; } .rvo-legend .pending::before { background: #f59e0b; } .rvo-legend .confirmed::before { background: #dc2626; }
.rvo-legend .blk::before { background: var(--surface-alt); border: 1px solid var(--border); }
.rvo-legend .c::before { background: #16a34a; }
.rvo-legend .p::before { background: #f59e0b; }
.rvo-periods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rvo-cards { display: grid; gap: 10px; margin-top: 10px; }
.rvo-card { border: 1px solid var(--border); border-left: 4px solid #9ca3af; border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 4px; }
.rvo-card.st-pending { border-left-color: #f59e0b; } .rvo-card.st-confirmed { border-left-color: #16a34a; } .rvo-card.st-expired { border-left-color: #dc2626; }
.rvo-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rvo-card-main { font-size: 14px; }
.rvo-card a { color: var(--primary); }
.rvo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
