/* Base */
html, body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.no-scroll { overflow: hidden; }

/* Ícones */
.ico-sm { width: 20px; height: 20px; }
.ico-md { width: 24px; height: 24px; }

/* Layout */
.app-body {
  background: #f1f5f9; /* slate-100 */
  min-height: 100vh;
}

/* Desktop: layout lado a lado (sidebar + main) */
@media (min-width: 768px) {
  .app-body {
    display: flex;
  }
}

/* Overlay mobile */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: none;
  z-index: 40;
}
.mobile-overlay-show { display: block; }

/* Sidebar: mobile drawer */
.sidebar {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  width: 16rem; /* 64 */
  transition: transform 0.25s ease, width 0.25s ease;
  z-index: 50;

  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;

  transform: translateX(-100%);
}
.sidebar-open { transform: translateX(0); }

/* Desktop: sidebar fixo no layout (não drawer) */
@media (min-width: 768px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    transform: none;
  }
  .sidebar-open { transform: none; }
}

/* Desktop collapsed */
@media (min-width: 768px) {
  .sidebar.sidebar-collapsed { width: 5rem; /* 20 */ }
}

/* Header sidebar */
.sidebar-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #e2e8f0;
}
.sidebar-logo {
  height: 32px;
  object-fit: contain;
}

/* Buttons */
.sidebar-btn {
  padding: 8px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-btn:hover { background: #f1f5f9; }

.sidebar-btn-desktop { display: none; }
.sidebar-btn-mobile { display: inline-flex; }

@media (min-width: 768px) {
  .sidebar-btn-desktop { display: inline-flex; }
  .sidebar-btn-mobile { display: none; }
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  color: #475569;
  text-decoration: none;
  font-size: 14px;
}
.sidebar-link:hover { background: #f1f5f9; }

.sidebar-link-active {
  background: #ecfdf5;
  color: #047857;
  font-weight: 600;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid #e2e8f0;
}

.sidebar-link-logout { color: #e11d48; }
.sidebar-link-logout:hover { background: #fff1f2; }

/* Main */
.app-main{
  width: 100%;
  min-width: 0; /* evita corte por overflow do flex */
}

/* Topbar */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  height: 64px;
  padding: 0 16px; /* mais “real”, avatar no máximo da direita com padding mínimo */
  display: flex;
  align-items: center;
}
.topbar-inner {
  width: 100%;
  max-width: none;   /* GARANTE: não vira container “centralizado” */
  margin: 0;         /* remove qualquer “margem fantasma” */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  color: #334155;
  font-weight: 600;
  font-size: 16px;
}
.topbar-title-strong { color: #0f172a; }
.topbar-title-muted { color: #94a3b8; font-weight: 400; margin-left: 6px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto; /* reforça colar à direita */
}

.topbar-user {
  text-align: right;
  line-height: 1.1;
  display: none;
}
@media (min-width: 640px) {
  .topbar-user { display: block; }
}

.topbar-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.topbar-user-role {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

/* Content */
.content{
  width: 100%;
  padding: 24px; /* padding global desktop */
}

/* AQUI estava “cagando” o layout: max-width 1200 deixava tudo pequeno */
.content-inner {
  width: 100%;
  max-width: none;  /* usa a página toda */
  margin: 0;        /* sem centralização */
}

/* Cards (tamanho “bonito”, não encolhe) */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

/* Em telas médias, 2 colunas */
@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Em telas grandes, 4 colunas (aproveita a largura agora que não tem max-width) */
@media (min-width: 1024px) {
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 92px;
}
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Força cores dos ícones dos cards */
.card-icon-ok     { background: #d1fae5 !important; color: #059669 !important; }
.card-icon-warn   { background: #fef3c7 !important; color: #d97706 !important; }
.card-icon-info   { background: #dbeafe !important; color: #2563eb !important; }
.card-icon-danger { background: #ffe4e6 !important; color: #e11d48 !important; }

.card-label {
  font-size: 14px;
  color: #64748b;
}
.card-value {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
}

/* Panel */
.panel{
  width: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
}

.panel-title {
  font-weight: 600;
  color: #334155;
  font-size: 16px;
}
.panel-sub {
  margin-top: 8px;
  color: #64748b;
  font-size: 14px;
}

/* Dot status (Online) */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  border: 2px solid #e2e8f0;
  vertical-align: middle;
}

.dot-online  { background: #16a34a; border-color: #bbf7d0; } /* verde */
.dot-blocked { background: #dc2626; border-color: #fecaca; } /* vermelho */
.dot-empty   { background: #94a3b8; border-color: #e2e8f0; } /* cinza */

/* Botões genéricos (mantidos) */
.btn{
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
}

.btn-outline-danger{
  border: 1px solid #fca5a5;
  color: #dc2626;
}
.btn-outline-danger:hover{ background: #fee2e2; }

.btn-outline-success{
  border: 1px solid #86efac;
  color: #16a34a;
}
.btn-outline-success:hover{ background: #dcfce7; }

/* Mobile shadow on drawer + paddings */
@media (max-width: 767px) {
  .sidebar {
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  }

  .content {
    padding: 16px;
  }

  .topbar {
    padding: 0 12px;
  }

  .topbar-title {
    font-size: 14px;
  }

  .card-value {
    font-size: 24px;
  }
}

/* Mobile: sidebar fica fixa e pode rolar por dentro */
@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}


/* ===========================
   Modal de Ação (Informar/Perguntar)
   =========================== */

.acao-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: none;
  z-index: 1000;
}

.acao-overlay.show {
  display: block;
}

.acao-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1001;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.acao-modal.show {
  display: flex;
}

.acao-card {
  width: min(520px, 96vw);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}

.acao-modal.show .acao-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.acao-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.acao-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.acao-title {
  font-weight: 800;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.2;
}

.acao-body {
  padding: 14px 16px 4px;
}

.acao-msg {
  color: #334155;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.acao-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 16px 16px;
}

.acao-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
}

.acao-btn:hover { background: #f8fafc; }

.acao-btn-primary {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}
.acao-btn-primary:hover { filter: brightness(0.95); }

.acao-btn-danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}
.acao-btn-danger:hover { background: #ffe4e6; }

.acao-btn-ghost {
  background: #fff;
  border-color: #e2e8f0;
  color: #334155;
}

/* Tipos */
.acao-icon.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.acao-icon.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}
.acao-icon.danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}
.acao-icon.success {
  background: #ecfdf5;
  border-color: #86efac;
  color: #047857;
}

/* Check animado (sucesso) */
.acao-check {
  width: 22px;
  height: 22px;
  display: block;
}
.acao-check path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: acao-draw .42s ease forwards;
}
@keyframes acao-draw {
  to { stroke-dashoffset: 0; }
}

/* Esc / focus */
.acao-hidden {
  display: none !important;
}

/* ===========================
   Toggle PixPDV (Produção/Homologação)
   =========================== */

.pix-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.pix-toggle__label {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a; /* slate-900 */
  white-space: nowrap;
}

.pix-toggle__hint {
  font-size: 12px;
  font-weight: 600;
  color: #64748b; /* slate-500 */
  white-space: nowrap;
}

/* input escondido */
.pix-switch {
  position: absolute;
  margin-left: -9999px;
  visibility: hidden;
}

/* trilho */
.pix-switch + label {
  display: inline-block;
  position: relative;
  cursor: pointer;
  outline: none;
  user-select: none;

  width: 54px;
  height: 28px;
  border-radius: 999px;

  background: #ffffff;
  border: 1px solid #e2e8f0; /* slate-200 */
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);

  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

/* bolinha */
.pix-switch + label:after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #0f172a; /* slate-900 */
  transition: transform 0.18s ease;
}

/* checked = PRODUÇÃO (bolinha direita) */
.pix-switch:checked + label:after {
  transform: translateX(26px);
}

.pix-switch:checked + label {
  border-color: #0f172a;
}

/* foco acessível */
.pix-switch:focus + label {
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.18), 0 1px 2px rgba(15, 23, 42, 0.06);
}


.in[readonly]{
  background:#f8fafc;
  color:#94a3b8;
  border-color:#e5e7eb;
  cursor:not-allowed;
  box-shadow:none;
}


/* Header do card: esquerda (texto) / direita (ações) */
.pix-card-head{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:12px;
  align-items:start;
}

/* Evita que ações "amassem" o texto */
.pix-card-actions{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;          /* se faltar espaço, quebra os botões, NÃO o valor */
  max-width: 260px;        /* trava a área dos botões */
}

/* Botões menores e consistentes */
.pix-card-actions .btn{
  padding:10px 14px;
  border-radius:12px;
  height:40px;
  line-height:1;
  white-space:nowrap;
}

/* Valor do card NÃO quebra */
.pix-card-value{
  white-space:nowrap;
  word-break:keep-all;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Se teu .card-value for block e gigante, reforça */
.card-value, #pixTotal, #pixDisponivel, #pixBloqueado{
  white-space:nowrap;
}
