/* ============================================================================
   DoutorPDV — Design System & Responsive Layout
   Bootstrap 5.3 + Design Tokens refinados (Desktop, Tablet, Mobile e Totens)
   ============================================================================ */

:root {
  --dp-primary: #2563eb;
  --dp-primary-hover: #1d4ed8;
  --dp-primary-soft: #eff6ff;
  --dp-ink: #0f172a;
  --dp-ink-muted: #475569;
  --dp-ink-subtle: #64748b;
  --dp-canvas: #f5f7fb;
  --dp-surface: #ffffff;
  --dp-border: #e2e8f0;
  --dp-border-strong: #cbd5e1;
  --dp-sidebar-bg: #0f172a;
  --dp-sidebar-text: #cbd5e1;
  --dp-sidebar-muted: #64748b;
  --dp-sidebar-hover: rgba(255, 255, 255, 0.07);
  --dp-sidebar-active-bg: #2563eb;
  --dp-sidebar-width: 268px;
  --dp-sidebar-collapsed: 78px;
  --dp-topbar-height: 64px;
  --dp-radius: 12px;
  --dp-radius-sm: 8px;
  --dp-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --dp-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

/* Utilitário essencial para impedir estouro em containers flex/grid (Bootstrap 5 não inclui min-w-0) */
.min-w-0 {
  min-width: 0 !important;
}

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

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

a:hover {
  color: var(--dp-primary-hover);
}

/* ----------------------------------------------------------------------------
   Shell Principal (Sidebar + Topbar + Content)
   ---------------------------------------------------------------------------- */

.dp-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.dp-sidebar {
  width: var(--dp-sidebar-width);
  background: var(--dp-sidebar-bg);
  color: var(--dp-sidebar-text);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  transition: width 0.22s ease, transform 0.22s ease;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.dp-sidebar-brand {
  height: var(--dp-topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.dp-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--dp-primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  flex-shrink: 0;
}

.dp-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  overflow: hidden;
  white-space: nowrap;
}

.dp-brand-title {
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.dp-brand-sub {
  font-size: 0.72rem;
  color: #94a3b8;
}

.dp-sidebar-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 12px 24px;
}

.dp-sidebar-scroll::-webkit-scrollbar {
  width: 5px;
}

.dp-sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 99px;
}

.dp-nav-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dp-sidebar-muted);
  padding: 14px 12px 6px;
  white-space: nowrap;
  overflow: hidden;
}

.dp-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--dp-radius-sm);
  color: var(--dp-sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.dp-nav-link i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.9;
}

.dp-nav-link:hover {
  background: var(--dp-sidebar-hover);
  color: #ffffff;
}

.dp-nav-link.active {
  background: var(--dp-sidebar-active-bg);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.dp-nav-link.active i {
  opacity: 1;
}

.dp-nav-badge {
  margin-left: auto;
  font-size: 0.66rem;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 600;
}

.dp-sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.dp-tenant-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--dp-radius-sm);
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.dp-tenant-pill .dp-tenant-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dp-tenant-pill .dp-tenant-meta {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Area */
.dp-main {
  flex: 1 1 auto;
  margin-left: var(--dp-sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.22s ease;
}

/* Collapsed sidebar on desktop */
body.dp-sidebar-collapsed .dp-sidebar {
  width: var(--dp-sidebar-collapsed);
}

body.dp-sidebar-collapsed .dp-main {
  margin-left: var(--dp-sidebar-collapsed);
}

body.dp-sidebar-collapsed .dp-brand-text,
body.dp-sidebar-collapsed .dp-nav-section-title,
body.dp-sidebar-collapsed .dp-nav-label,
body.dp-sidebar-collapsed .dp-nav-badge,
body.dp-sidebar-collapsed .dp-tenant-info {
  display: none;
}

body.dp-sidebar-collapsed .dp-sidebar-brand {
  justify-content: center;
  padding: 0;
}

body.dp-sidebar-collapsed .dp-nav-link {
  justify-content: center;
  padding: 10px;
}

/* Topbar */
.dp-topbar {
  height: var(--dp-topbar-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--dp-border);
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 12px;
}

.dp-topbar-left,
.dp-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dp-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--dp-radius-sm);
  border: 1px solid var(--dp-border);
  background: var(--dp-surface);
  color: var(--dp-ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.dp-icon-btn:hover {
  background: #f8fafc;
  color: var(--dp-ink);
  border-color: var(--dp-border-strong);
}

.dp-context-select {
  height: 38px;
  border-radius: var(--dp-radius-sm);
  border: 1px solid var(--dp-border);
  background-color: var(--dp-surface);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--dp-ink);
  padding: 0 28px 0 12px;
  max-width: 230px;
}

.dp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dp-primary-soft);
  color: var(--dp-primary);
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(37, 99, 235, 0.18);
}

/* Content Area */
.dp-content {
  flex: 1 1 auto;
  padding: 24px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.dp-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.dp-page-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--dp-ink);
  margin: 0;
}

.dp-page-subtitle {
  font-size: 0.875rem;
  color: var(--dp-ink-subtle);
  margin: 3px 0 0;
}

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

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

.dp-card-title {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--dp-ink);
  margin: 0;
}

.dp-card-body {
  padding: 20px;
}

/* Stat Cards */
.dp-stat-card {
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--dp-shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
}

.dp-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--dp-shadow);
}

.dp-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dp-ink-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dp-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--dp-ink);
  line-height: 1.2;
  margin-top: 6px;
}

.dp-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Tables */
.dp-table {
  margin-bottom: 0;
  vertical-align: middle;
}

.dp-table thead th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--dp-ink-subtle);
  background: #f8fafc;
  border-bottom: 1px solid var(--dp-border);
  padding: 12px 16px;
  white-space: nowrap;
}

.dp-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
}

.dp-table tbody tr:last-child td {
  border-bottom: 0;
}

.dp-table tbody tr:hover {
  background-color: #fafcff;
}

/* Permission Matrix */
.dp-perm-module-card {
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius-sm);
  overflow: hidden;
  background: var(--dp-surface);
  height: 100%;
}

.dp-perm-module-head {
  background: #f8fafc;
  padding: 11px 14px;
  border-bottom: 1px solid var(--dp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dp-perm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s ease;
}

.dp-perm-item:last-child {
  border-bottom: 0;
}

.dp-perm-item:hover {
  background: #f8fafc;
}

.dp-perm-item.is-inherited {
  background: #f0fdf4;
}

.dp-perm-item.is-direct {
  background: #eff6ff;
}

.dp-code-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  display: inline-block;
}

/* Badges & Buttons */
.btn-primary {
  background-color: var(--dp-primary);
  border-color: var(--dp-primary);
  font-weight: 500;
}

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

.btn {
  border-radius: var(--dp-radius-sm);
}

.form-control,
.form-select {
  border-radius: var(--dp-radius-sm);
  border-color: var(--dp-border-strong);
  font-size: 0.89rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--dp-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* ----------------------------------------------------------------------------
   Auth / Login Screen
   ---------------------------------------------------------------------------- */

.dp-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at top right, #e0ecff 0%, #f5f7fb 45%, #eef2f7 100%);
}

.dp-auth-card {
  width: 100%;
  max-width: 960px;
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px -15px rgba(15, 23, 42, 0.12);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.dp-auth-showcase {
  background: var(--dp-sidebar-bg);
  color: #e2e8f0;
  padding: 42px 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dp-auth-form-wrap {
  padding: 42px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ----------------------------------------------------------------------------
   Totem Autoatendimento Preview (Adaptável a qualquer resolução)
   ---------------------------------------------------------------------------- */

.dp-totem-stage {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.dp-totem-frame {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--dp-border-strong);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--dp-shadow);
  transition: max-width 0.25s ease;
  display: flex;
  flex-direction: column;
}

.dp-totem-frame[data-mode="kiosk-vertical"] {
  max-width: 480px;
  min-height: 760px;
}

.dp-totem-frame[data-mode="tablet"] {
  max-width: 780px;
  min-height: 620px;
}

.dp-totem-frame[data-mode="kiosk-wide"] {
  max-width: 100%;
  min-height: 600px;
}

.dp-totem-frame[data-mode="mobile"] {
  max-width: 375px;
  min-height: 680px;
}

.dp-totem-header {
  background: var(--dp-sidebar-bg);
  color: #ffffff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dp-totem-body {
  display: grid;
  grid-template-columns: 1fr 310px;
  flex: 1 1 auto;
}

.dp-totem-frame[data-mode="kiosk-vertical"] .dp-totem-body,
.dp-totem-frame[data-mode="mobile"] .dp-totem-body {
  grid-template-columns: 1fr;
}

.dp-totem-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px;
  border-bottom: 1px solid var(--dp-border);
  background: #f8fafc;
}

.dp-totem-cat-btn {
  border: 1px solid var(--dp-border);
  background: #ffffff;
  color: var(--dp-ink);
  border-radius: 99px;
  padding: 9px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dp-totem-cat-btn.active {
  background: var(--dp-primary);
  border-color: var(--dp-primary);
  color: #ffffff;
}

.dp-totem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
  padding: 16px;
}

.dp-totem-product {
  border: 1px solid var(--dp-border);
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dp-totem-product:hover {
  border-color: var(--dp-primary);
  box-shadow: 0 6px 18px -6px rgba(37, 99, 235, 0.2);
}

.dp-totem-cart {
  border-left: 1px solid var(--dp-border);
  background: #f8fafc;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dp-totem-frame[data-mode="kiosk-vertical"] .dp-totem-cart,
.dp-totem-frame[data-mode="mobile"] .dp-totem-cart {
  border-left: 0;
  border-top: 1px solid var(--dp-border);
}

/* ----------------------------------------------------------------------------
   Responsividade Mobile / Tablet (< 992px)
   ---------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
  .dp-sidebar {
    display: none;
  }

  .dp-main,
  body.dp-sidebar-collapsed .dp-main {
    margin-left: 0;
  }

  .dp-topbar {
    padding: 0 14px;
  }

  .dp-content {
    padding: 16px 14px 28px;
  }

  .dp-auth-card {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .dp-auth-showcase {
    display: none;
  }

  .dp-auth-form-wrap {
    padding: 28px 22px;
  }

  .dp-totem-body {
    grid-template-columns: 1fr;
  }

  .dp-totem-cart {
    border-left: 0;
    border-top: 1px solid var(--dp-border);
  }
}

@media (max-width: 575.98px) {
  .dp-page-title {
    font-size: 1.25rem;
  }

  .dp-card-body {
    padding: 14px;
  }

  .dp-context-select {
    max-width: 145px;
    font-size: 0.78rem;
  }
}

/* Mobile Offcanvas Sidebar Styling */
.dp-offcanvas {
  background: var(--dp-sidebar-bg);
  color: var(--dp-sidebar-text);
  width: 280px !important;
}

.dp-offcanvas .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}



/* ============================================================================
   FASE 2 — Modal Alerts, Tabbed Modals, Context Banner, Produtos, PDV e Totem
   ============================================================================ */

.dp-alert-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.dp-context-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--dp-radius);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Modal Tabs limpas */
.dp-modal-tabs {
  border-bottom: 1px solid var(--dp-border);
  background: #f8fafc;
  padding: 0 20px;
}

.dp-modal-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dp-ink-muted);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 13px 16px;
  border-radius: 0;
  background: transparent;
}

.dp-modal-tabs .nav-link:hover {
  color: var(--dp-ink);
}

.dp-modal-tabs .nav-link.active {
  color: var(--dp-primary);
  border-bottom-color: var(--dp-primary);
  background: transparent;
}

/* Product Thumbnails & Dropzone */
.dp-prod-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--dp-border);
  background: #f8fafc;
  flex-shrink: 0;
}

.dp-prod-thumb-empty {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1px dashed var(--dp-border-strong);
  background: #f8fafc;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.dp-dropzone {
  border: 2px dashed var(--dp-border-strong);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  background: #f8fafc;
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.dp-dropzone:hover,
.dp-dropzone.is-dragover {
  border-color: var(--dp-primary);
  background: #eff6ff;
}

.dp-img-preview-box {
  width: 100%;
  max-height: 220px;
  border-radius: 12px;
  border: 1px solid var(--dp-border);
  background: #ffffff;
  object-fit: contain;
  padding: 6px;
}

/* ----------------------------------------------------------------------------
   PDV Fullscreen (Sem sidebar, foco 100% operacional)
   ---------------------------------------------------------------------------- */

.dp-pdv-body {
  background: #eef2f7;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dp-pdv-topbar {
  height: 58px;
  background: #0f172a;
  color: #ffffff;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.dp-pdv-workspace {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(330px, 31vw, 410px);
  width: 100%;
  max-width: 100vw;
  min-height: 0;
  overflow: hidden;
}

.dp-pdv-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 14px 16px;
  gap: 12px;
}

.dp-pdv-right {
  background: #ffffff;
  border-left: 1px solid var(--dp-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.dp-pdv-catalog {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-auto-rows: max-content;
  gap: 10px;
  align-content: start;
  align-items: stretch;
  padding-right: 4px;
  padding-bottom: 18px;
}

.dp-pdv-card {
  background: #ffffff;
  border: 1px solid var(--dp-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.dp-pdv-card:hover {
  border-color: var(--dp-primary);
  box-shadow: 0 8px 18px -6px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

.dp-pdv-card-img {
  height: 96px;
  width: 100%;
  flex-shrink: 0;
  object-fit: cover;
  background: #f8fafc;
}

.dp-pdv-cart-items {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 14px;
}

.dp-pdv-cart-footer {
  border-top: 1px solid var(--dp-border);
  padding: 12px 14px;
  background: #f8fafc;
  min-width: 0;
  overflow: hidden;
}

.dp-pdv-total-val {
  font-size: clamp(1.35rem, 2.2vw, 1.95rem);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dp-kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
}

/* Cupom Térmico para impressão */
.dp-receipt-paper {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12.5px;
  background: #fffdf5;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 18px;
  color: #111827;
  max-width: 340px;
  margin: 0 auto;
}

@media (max-width: 991.98px) {
  .dp-pdv-body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .dp-pdv-workspace {
    grid-template-columns: 1fr;
  }

  .dp-pdv-right {
    border-left: 0;
    border-top: 1px solid var(--dp-border);
  }
}

/* ----------------------------------------------------------------------------
   Totem Autoatendimento Fullscreen (Sem Header, Scroll Independente, Touch-First)
   ---------------------------------------------------------------------------- */

.dp-kiosk-body {
  background: #f1f5f9;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.dp-kiosk-attract {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: radial-gradient(circle at 20% 20%, #1d4ed8 0%, #0f172a 70%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 20px;
  overflow-y: auto;
}

.dp-kiosk-pulse-btn {
  padding: 20px 40px;
  font-size: clamp(1.05rem, 2.3vw, 1.55rem);
  font-weight: 800;
  border-radius: 99px;
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  animation: dpPulse 2s infinite;
}

@keyframes dpPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.65);
  }

  70% {
    box-shadow: 0 0 0 22px rgba(59, 130, 246, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

.dp-kiosk-steps {
  background: #ffffff;
  border-bottom: 1px solid var(--dp-border);
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.dp-kiosk-steps-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.dp-kiosk-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.dp-kiosk-step .dp-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
}

.dp-kiosk-step.active {
  color: var(--dp-primary);
}

.dp-kiosk-step.active .dp-step-num {
  background: var(--dp-primary);
  color: #ffffff;
}

/* Workspace do Totem com 2 colunas independentes e scroll independente */
.dp-kiosk-main {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  min-height: 0;
  height: 0;
  overflow: hidden;
}

/* Rail Esquerdo (Logo fixa no topo + Categorias com scroll próprio + Controles fixos no rodapé) */
.dp-kiosk-rail-wrap {
  background: #ffffff;
  border-right: 1px solid var(--dp-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.dp-kiosk-rail-brand {
  padding: 12px 10px 10px;
  border-bottom: 1px solid var(--dp-border);
  text-align: center;
  flex-shrink: 0;
  background: #f8fafc;
}

.dp-kiosk-cat-rail {
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dp-kiosk-cat-rail::-webkit-scrollbar,
.dp-kiosk-grid-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.dp-kiosk-cat-rail::-webkit-scrollbar-thumb,
.dp-kiosk-grid-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}

.dp-kiosk-rail-actions {
  padding: 10px;
  border-top: 1px solid var(--dp-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  background: #f8fafc;
}

.dp-kiosk-cat-tile {
  border: 2px solid var(--dp-border);
  background: #ffffff;
  border-radius: 15px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--dp-ink);
  flex-shrink: 0;
}

.dp-kiosk-cat-tile i {
  font-size: 1.65rem;
}

.dp-kiosk-cat-tile span {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
}

.dp-kiosk-cat-tile.active {
  border-color: var(--dp-primary);
  background: #eff6ff;
  color: var(--dp-primary);
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.35);
}

/* Coluna Direita (Passos fixos + Grade de Produtos com scroll próprio) */
.dp-kiosk-content-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.dp-kiosk-grid-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 22px;
}

.dp-kiosk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 15px;
  align-content: start;
}

.dp-kiosk-product {
  background: #ffffff;
  border: 2px solid transparent;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.dp-kiosk-product.in-cart {
  border-color: var(--dp-primary);
}

.dp-kiosk-product:active {
  transform: scale(0.985);
}

.dp-kiosk-product-img {
  width: 100%;
  height: 148px;
  object-fit: cover;
  background: #f8fafc;
}

/* Preço sempre centralizado, sem quebrar linha e sem estourar o card */
.dp-kiosk-price-box {
  width: 100%;
  text-align: center;
  overflow: hidden;
  padding: 2px 0;
}

.dp-kiosk-price {
  display: block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(1rem, 1.35vw, 1.28rem);
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.dp-kiosk-bottom-bar {
  flex-shrink: 0;
  z-index: 1020;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.22);
}

.dp-touch-choice {
  border: 2px solid var(--dp-border);
  border-radius: 18px;
  padding: 20px 14px;
  background: #ffffff;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dp-touch-choice:hover,
.dp-touch-choice.active {
  border-color: var(--dp-primary);
  background: #eff6ff;
  color: var(--dp-primary);
}

.dp-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 280px;
  margin: 0 auto;
}

.dp-keypad-btn {
  height: 52px;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 12px;
}

@media (max-width: 767.98px) {
  .dp-kiosk-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .dp-kiosk-rail-wrap {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--dp-border);
  }

  .dp-kiosk-rail-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    text-align: left;
  }

  .dp-kiosk-rail-logo {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    margin: 0;
  }

  .dp-kiosk-cat-rail {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
  }

  .dp-kiosk-rail-actions {
    flex-direction: row;
    padding: 6px 10px;
  }

  .dp-kiosk-cat-tile {
    min-width: 92px;
    padding: 8px 6px;
  }

  .dp-kiosk-cat-tile i {
    font-size: 1.35rem;
  }

  .dp-kiosk-grid-scroll {
    padding: 12px;
  }

  .dp-kiosk-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .dp-kiosk-product-img {
    height: 112px;
  }

  .dp-kiosk-bottom-bar {
    padding: 10px 14px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .dp-receipt-printable,
  .dp-receipt-printable * {
    visibility: visible;
  }

  .dp-receipt-printable {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
  }
}


/* ============================================================================
   FASE 3 — Logo Oficial, Login Minimalista, Biblioteca Visual (Resize & Crop)
   ============================================================================ */

.dp-login-card-clean {
  width: 100%;
  max-width: 420px;
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px -15px rgba(15, 23, 42, 0.12);
}

.dp-login-logo {
  width: 118px;
  height: 118px;
  object-fit: contain;
  border-radius: 24px;
  background: #162340;
  box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.28);
}

/* Símbolo compacto da logo (recorta apenas o ícone limpo, sem texto microscópico) */
.dp-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #162340;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  flex-shrink: 0;
}

.dp-logo-mark img {
  width: 142%;
  height: 142%;
  max-width: none;
  object-fit: cover;
  transform: translateY(10%);
  display: block;
}

.dp-logo-mark-sm {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.dp-brand-logo,
.dp-brand-logo-icon {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: #162340;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.dp-kiosk-logo-hero {
  width: 128px;
  height: 128px;
  object-fit: contain;
  border-radius: 28px;
  background: #162340;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.42);
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.dp-kiosk-rail-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 20px;
  background: #162340;
  box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: block;
  margin: 0 auto;
}

.dp-money-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------------------
   Biblioteca de Imagens — Editor Visual (Resize + Crop arrastando com mouse)
   ---------------------------------------------------------------------------- */

.dp-media-card {
  background: #ffffff;
  border: 1px solid var(--dp-border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dp-media-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--dp-shadow);
  border-color: var(--dp-primary);
}

.dp-media-thumb-wrap {
  height: 165px;
  background: repeating-conic-gradient(#f1f5f9 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.dp-media-thumb-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.dp-editor-stage {
  background: repeating-conic-gradient(#e2e8f0 0% 25%, #f8fafc 0% 50%) 50% / 18px 18px;
  border: 1px solid var(--dp-border-strong);
  border-radius: 14px;
  min-height: 400px;
  max-height: 520px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  position: relative;
  user-select: none;
}

.dp-resize-box {
  position: relative;
  display: inline-block;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  outline: 2px dashed var(--dp-primary);
  outline-offset: 2px;
}

.dp-resize-box img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.dp-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2.5px solid var(--dp-primary);
  border-radius: 50%;
  z-index: 15;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.dp-handle-nw {
  top: -7px;
  left: -7px;
  cursor: nwse-resize;
}

.dp-handle-ne {
  top: -7px;
  right: -7px;
  cursor: nesw-resize;
}

.dp-handle-sw {
  bottom: -7px;
  left: -7px;
  cursor: nesw-resize;
}

.dp-handle-se {
  bottom: -7px;
  right: -7px;
  cursor: nwse-resize;
}

.dp-handle-n {
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.dp-handle-s {
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.dp-handle-w {
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.dp-handle-e {
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.dp-crop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 10;
}

.dp-crop-rect {
  position: absolute;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
  cursor: move;
  z-index: 12;
  background: transparent;
}

.dp-crop-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
}