/* =====================================================================
   PEDIDOS LANÇADOS — estilos do módulo (escopo: #screen-pedidos)
   Reaproveita as variáveis do app e o mesmo banco/config.
   ===================================================================== */
#screen-pedidos {
  --pd-bg: #eef2f7;
  --pd-card: #ffffff;
  --pd-ink: #0f172a;
  --pd-ink-2: #475569;
  --pd-ink-3: #94a3b8;
  --pd-line: #e2e8f0;
  --pd-blue: #0a66c2;
  --pd-blue-2: #0d8bd9;
  --pd-green: #16a34a;
  --pd-amber: #f59e0b;
  --pd-red: #dc2626;
  --pd-side: #0f172a;
  --pd-side-2: #1e293b;
  --pd-radius: 14px;
  margin: -6px -12px -6px;
  padding: 0;
  background: var(--pd-bg);
  min-height: calc(100vh - 60px);
}
#screen-pedidos * { box-sizing: border-box; }
#screen-pedidos button {
  font-family: inherit;
  background: none;
  color: inherit;
  box-shadow: none;
  border-radius: 9px;
  padding: 8px 12px;
  letter-spacing: 0;
  overflow: visible;
}
#screen-pedidos button::after { display: none; }
#screen-pedidos input,
#screen-pedidos select,
#screen-pedidos textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--pd-ink);
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: 9px;
  padding: 9px 11px;
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#screen-pedidos input:focus,
#screen-pedidos select:focus,
#screen-pedidos textarea:focus {
  border-color: var(--pd-blue);
  box-shadow: 0 0 0 3px rgba(10, 102, 194, .12);
}
#screen-pedidos textarea { resize: vertical; min-height: 74px; }
#screen-pedidos label { font-size: 12px; color: var(--pd-ink-2); }

/* ---------- Estrutura ---------- */
.pd-app {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: calc(100vh - 58px);
  background: var(--pd-bg);
}
.pd-sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #111c33 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 58px);
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
}
.pd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.pd-brand-logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(135deg, #0a66c2, #0d8bd9);
  box-shadow: 0 6px 16px rgba(10,102,194,.45);
}
.pd-brand-txt strong { display: block; color: #fff; font-size: 14px; letter-spacing: .2px; }
.pd-brand-txt span { font-size: 11px; color: #7f8ea3; }
.pd-side-scroll { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.pd-side-scroll::-webkit-scrollbar { width: 6px; }
.pd-side-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 6px; }
.pd-side-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.1px;
  color: #64748b; text-transform: uppercase;
  padding: 14px 8px 7px;
}
.pd-side-label button {
  width: 22px; height: 22px; padding: 0; border-radius: 6px;
  color: #94a3b8; font-size: 15px; line-height: 1;
  display: grid; place-items: center;
}
.pd-side-label button:hover { background: rgba(255,255,255,.1); color: #fff; }
.pd-side-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left; padding: 8px 9px;
  border-radius: 9px; color: #cbd5e1; font-size: 12.5px; font-weight: 600;
  transition: background .15s, color .15s;
}
.pd-side-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.pd-side-item.active { background: linear-gradient(135deg, rgba(10,102,194,.9), rgba(13,139,217,.75)); color: #fff; box-shadow: 0 4px 14px rgba(10,102,194,.3); }
.pd-side-item .pd-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.pd-side-item .pd-count {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  background: rgba(255,255,255,.1); color: #cbd5e1;
  padding: 1px 7px; border-radius: 20px;
}
.pd-side-item.active .pd-count { background: rgba(255,255,255,.25); color: #fff; }
.pd-side-item .pd-prefix {
  font-size: 9.5px; font-weight: 800; letter-spacing: .5px;
  background: rgba(255,255,255,.08); color: #94a3b8;
  padding: 2px 5px; border-radius: 5px;
}
.pd-user-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border-radius: 9px; text-align: left; }
.pd-user-row:hover { background: rgba(255,255,255,.06); }
.pd-user-row .pd-user-name { font-size: 12.5px; font-weight: 600; color: #dbe4ef; }
.pd-user-row .pd-user-sub { font-size: 10.5px; color: #64748b; }
.pd-avatar {
  position: relative; width: 32px; height: 32px; flex: 0 0 auto;
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, #0a66c2, #0d8bd9);
  overflow: visible;
}
.pd-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pd-avatar .pd-status-dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid #0f172a; background: #64748b;
}
.pd-status-dot.online { background: #22c55e; }
.pd-status-dot.ocupado { background: #ef4444; }
.pd-status-dot.ausente { background: #eab308; }
.pd-status-dot.offline { background: #475569; }
.pd-side-foot {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 10px; display: flex; align-items: center; gap: 9px;
}
.pd-side-foot .pd-user-name { color: #fff; font-size: 12.5px; font-weight: 700; }
.pd-side-foot .pd-user-sub { font-size: 10.5px; color: #7f8ea3; }
.pd-side-foot .pd-foot-actions { margin-left: auto; display: flex; gap: 4px; }
.pd-side-foot button { padding: 5px; color: #94a3b8; font-size: 14px; border-radius: 7px; }
.pd-side-foot button:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- Main ---------- */
.pd-main { min-width: 0; display: flex; flex-direction: column; }
.pd-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--pd-line);
  position: sticky; top: 0; z-index: 30;
}
.pd-search { position: relative; flex: 1; max-width: 560px; }
.pd-search span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--pd-ink-3); font-size: 14px; }
.pd-search input { padding-left: 34px; background: #f8fafc; border-color: transparent; }
.pd-search input:focus { background: #fff; }
.pd-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pd-icon-btn {
  position: relative; width: 38px; height: 38px; padding: 0 !important;
  display: grid; place-items: center; font-size: 17px;
  background: #fff; border: 1px solid var(--pd-line); border-radius: 11px;
  color: var(--pd-ink-2);
}
.pd-icon-btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.pd-bell-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px;
  padding: 0 4px; border-radius: 20px; background: var(--pd-red); color: #fff;
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid #fff;
}
.pd-btn-primary {
  background: linear-gradient(135deg, var(--pd-blue), var(--pd-blue-2)) !important;
  color: #fff !important; font-weight: 700; padding: 9px 15px !important;
  box-shadow: 0 5px 14px rgba(10,102,194,.28) !important;
}
.pd-btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.pd-btn-ghost { background: #fff !important; border: 1px solid var(--pd-line) !important; color: var(--pd-ink-2) !important; font-weight: 600; }
.pd-btn-ghost:hover { background: #f8fafc !important; border-color: #cbd5e1 !important; }
.pd-btn-danger { background: #fef2f2 !important; border: 1px solid #fecaca !important; color: var(--pd-red) !important; font-weight: 700; }
.pd-btn-danger:hover { background: #fee2e2 !important; }
.pd-content { padding: 20px 22px 40px; }

/* ---------- Cabeçalho de página ---------- */
.pd-page-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pd-page-title { font-size: 21px; font-weight: 800; color: var(--pd-ink); margin: 0; letter-spacing: -.3px; }
.pd-page-sub { font-size: 12.5px; color: var(--pd-ink-2); margin: 3px 0 0; }
.pd-page-head .pd-head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pd-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.pd-stat {
  background: #fff; border: 1px solid var(--pd-line); border-radius: 12px;
  padding: 12px 14px; display: flex; align-items: center; gap: 11px;
}
.pd-stat .pd-stat-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: #eff6ff; }
.pd-stat .pd-stat-num { font-size: 19px; font-weight: 800; color: var(--pd-ink); line-height: 1; }
.pd-stat .pd-stat-lbl { font-size: 10.5px; color: var(--pd-ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }
.pd-stat.green .pd-stat-ico { background: #ecfdf5; }
.pd-stat.amber .pd-stat-ico { background: #fffbeb; }
.pd-stat.red .pd-stat-ico { background: #fef2f2; }

/* ---------- Lista de pedidos ---------- */
.pd-list { display: flex; flex-direction: column; gap: 12px; }
.pd-order {
  background: var(--pd-card); border: 1px solid var(--pd-line);
  border-radius: var(--pd-radius); padding: 14px 16px 12px;
  position: relative; transition: box-shadow .18s, transform .18s, border-color .18s;
}
.pd-order:hover { box-shadow: 0 10px 28px rgba(15,23,42,.09); transform: translateY(-1px); }
.pd-order.urgent { border-color: #fca5a5; box-shadow: 0 0 0 1px #fecaca inset, 0 8px 22px rgba(220,38,38,.1); }
.pd-order.urgent::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--pd-red);
}
.pd-order-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pd-key {
  font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12.5px; font-weight: 800;
  color: var(--pd-blue); background: #eff6ff; border: 1px solid #dbeafe;
  padding: 3px 9px; border-radius: 7px; letter-spacing: .3px;
}
.pd-group-tag { font-size: 10.5px; font-weight: 700; color: var(--pd-ink-2); background: #f1f5f9; padding: 3px 8px; border-radius: 20px; }
.pd-badge { font-size: 10px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; padding: 3px 8px; border-radius: 20px; }
.pd-badge.pendente { background: #fffbeb; color: #b45309; }
.pd-badge.aprovado { background: #ecfdf5; color: #047857; }
.pd-badge.urgente { background: #fef2f2; color: #b91c1c; }
.pd-badge.encaminhado { background: #eff6ff; color: #1d4ed8; }
.pd-badge.financeiro { background: #f5f3ff; color: #6d28d9; }
.pd-order-top .pd-order-menu-btn { margin-left: auto; width: 30px; height: 30px; padding: 0 !important; display: grid; place-items: center; color: var(--pd-ink-3); font-size: 17px; border-radius: 8px; }
.pd-order-top .pd-order-menu-btn:hover { background: #f1f5f9; color: var(--pd-ink); }
.pd-order-meta { font-size: 11.5px; color: var(--pd-ink-3); margin: 5px 0 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pd-order-meta b { color: var(--pd-ink-2); font-weight: 700; }
.pd-order-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px 14px; margin-bottom: 11px; }
.pd-field-mini .pd-fm-l { font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--pd-ink-3); }
.pd-field-mini .pd-fm-v { font-size: 12.5px; color: var(--pd-ink); font-weight: 600; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-field-mini .pd-fm-v.money { color: #047857; font-weight: 800; }
.pd-order-foot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; border-top: 1px dashed var(--pd-line); padding-top: 9px; }
.pd-reaction {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700;
  background: #f8fafc; border: 1px solid var(--pd-line); border-radius: 20px;
  padding: 3px 8px; color: var(--pd-ink-2); cursor: pointer;
}
.pd-reaction:hover { border-color: #bfdbfe; background: #eff6ff; }
.pd-reaction.mine { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.pd-react-add { font-size: 12px; padding: 3px 9px !important; border: 1px dashed #cbd5e1 !important; border-radius: 20px !important; color: var(--pd-ink-3) !important; }
.pd-react-add:hover { border-color: var(--pd-blue) !important; color: var(--pd-blue) !important; background: #eff6ff !important; }
.pd-read-count { margin-left: auto; font-size: 11px; color: var(--pd-ink-3); display: inline-flex; align-items: center; gap: 4px; }
.pd-read-count b { color: var(--pd-ink-2); }

/* ---------- Menu 3 pontos ---------- */
.pd-menu-pop {
  position: fixed; z-index: 2000; min-width: 218px;
  background: #fff; border: 1px solid var(--pd-line); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(15,23,42,.2); padding: 6px; display: none;
}
.pd-menu-pop.show { display: block; }
.pd-menu-pop button {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 9px 10px; font-size: 12.5px; font-weight: 600; color: var(--pd-ink-2);
  border-radius: 8px;
}
.pd-menu-pop button:hover { background: #f1f5f9; color: var(--pd-ink); }
.pd-menu-pop button.danger { color: var(--pd-red); }
.pd-menu-pop button.danger:hover { background: #fef2f2; }
.pd-menu-sep { height: 1px; background: var(--pd-line); margin: 5px 4px; }

/* ---------- Estado vazio ---------- */
.pd-empty { text-align: center; padding: 54px 20px; color: var(--pd-ink-3); }
.pd-empty .pd-empty-ico { font-size: 44px; margin-bottom: 8px; opacity: .7; }
.pd-empty h3 { margin: 0 0 4px; color: var(--pd-ink-2); font-size: 15px; }
.pd-empty p { margin: 0 0 14px; font-size: 12.5px; }

/* ---------- Modal base ---------- */
.pd-modal {
  position: fixed; inset: 0; z-index: 3000; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(15,23,42,.55); backdrop-filter: blur(3px);
}
.pd-modal.show { display: flex; }
.pd-modal-box {
  background: #fff; border-radius: 18px; width: 100%; max-width: 860px;
  max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: pdIn .18s ease-out;
}
@keyframes pdIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.pd-modal-head {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  border-bottom: 1px solid var(--pd-line); flex: 0 0 auto;
}
.pd-modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--pd-ink); }
.pd-modal-head .pd-modal-sub { font-size: 11.5px; color: var(--pd-ink-3); }
.pd-modal-head .pd-x { margin-left: auto; width: 34px; height: 34px; padding: 0 !important; display: grid; place-items: center; font-size: 17px; color: var(--pd-ink-3); border-radius: 9px; }
.pd-modal-head .pd-x:hover { background: #f1f5f9; color: var(--pd-ink); }
.pd-modal-body { padding: 18px 20px; overflow-y: auto; }
.pd-modal-foot { padding: 13px 20px; border-top: 1px solid var(--pd-line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; flex: 0 0 auto; }
.pd-modal.wide .pd-modal-box { max-width: 1040px; }
.pd-modal.narrow .pd-modal-box { max-width: 460px; }

/* ---------- Formulário ---------- */
.pd-form-section { margin-bottom: 18px; }
.pd-form-section h4 {
  margin: 0 0 10px; font-size: 11px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; color: var(--pd-blue); display: flex; align-items: center; gap: 7px;
}
.pd-form-section h4::after { content: ''; flex: 1; height: 1px; background: var(--pd-line); }
.pd-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px 13px; }
.pd-form-grid .span-2 { grid-column: span 2; }
.pd-form-grid .span-3 { grid-column: span 3; }
.pd-field label { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .45px; text-transform: uppercase; color: var(--pd-ink-3); margin-bottom: 4px; }
.pd-field .pd-hint { font-size: 10.5px; color: var(--pd-ink-3); margin-top: 3px; }
.pd-key-row { display: flex; gap: 8px; align-items: center; }
.pd-key-row input[readonly] { background: #f1f5f9; color: var(--pd-blue); font-weight: 800; font-family: Consolas, monospace; }
.pd-check { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--pd-ink-2); cursor: pointer; }
.pd-check input { width: auto; }
.pd-drop {
  border: 2px dashed #cbd5e1; border-radius: 12px; padding: 16px; text-align: center;
  color: var(--pd-ink-3); font-size: 12px; cursor: pointer; transition: .15s;
}
.pd-drop:hover, .pd-drop.drag { border-color: var(--pd-blue); background: #eff6ff; color: var(--pd-blue); }
.pd-drop b { color: var(--pd-blue); }
.pd-files { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.pd-file {
  display: flex; align-items: center; gap: 8px; background: #f8fafc;
  border: 1px solid var(--pd-line); border-radius: 9px; padding: 7px 9px; font-size: 12px;
}
.pd-file .pd-file-ico { font-size: 15px; }
.pd-file .pd-file-name { font-weight: 600; color: var(--pd-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-file .pd-file-size { color: var(--pd-ink-3); font-size: 10.5px; }
.pd-file button { margin-left: auto; padding: 2px 6px !important; color: var(--pd-red) !important; font-size: 13px; }

/* ---------- Detalhe do pedido ---------- */
.pd-detail-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.pd-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px 16px; background: #f8fafc; border: 1px solid var(--pd-line); border-radius: 12px; padding: 14px; }
.pd-detail-grid .pd-dfield .l { font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--pd-ink-3); }
.pd-detail-grid .pd-dfield .v { font-size: 13px; color: var(--pd-ink); font-weight: 600; margin-top: 1px; }
.pd-detail-grid .pd-dfield .v.money { color: #047857; font-weight: 800; }
.pd-detail-sec { margin-top: 16px; }
.pd-detail-sec h4 { margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--pd-ink-3); }
.pd-obs { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 11px 13px; font-size: 12.5px; color: #78350f; white-space: pre-wrap; }
.pd-timeline { display: flex; flex-direction: column; gap: 0; }
.pd-tl-item { display: flex; gap: 10px; position: relative; padding-bottom: 12px; }
.pd-tl-item:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--pd-line); }
.pd-tl-ico { width: 27px; height: 27px; flex: 0 0 auto; border-radius: 50%; background: #eff6ff; display: grid; place-items: center; font-size: 12px; z-index: 1; }
.pd-tl-txt { font-size: 12px; color: var(--pd-ink-2); line-height: 1.45; }
.pd-tl-txt b { color: var(--pd-ink); }
.pd-tl-time { font-size: 10.5px; color: var(--pd-ink-3); }
.pd-comment { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px dashed var(--pd-line); }
.pd-comment:last-child { border-bottom: 0; }
.pd-comment .pd-comment-body { flex: 1; min-width: 0; }
.pd-comment .pd-comment-top { display: flex; align-items: baseline; gap: 7px; }
.pd-comment .pd-comment-name { font-size: 12px; font-weight: 800; color: var(--pd-ink); }
.pd-comment .pd-comment-time { font-size: 10.5px; color: var(--pd-ink-3); }
.pd-comment .pd-comment-txt { font-size: 12.5px; color: var(--pd-ink-2); margin-top: 2px; white-space: pre-wrap; }
.pd-comment .pd-comment-quote { font-size: 11px; color: var(--pd-ink-3); border-left: 2px solid #cbd5e1; padding-left: 7px; margin-top: 4px; }
.pd-comment-form { display: flex; gap: 8px; margin-top: 9px; }
.pd-comment-form input { flex: 1; }
.pd-reactions-big { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pd-reaction-big { display: inline-flex; align-items: center; gap: 5px; background: #f8fafc; border: 1px solid var(--pd-line); border-radius: 20px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: var(--pd-ink-2); cursor: pointer; }
.pd-reaction-big.mine { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.pd-reaction-big small { font-weight: 600; color: var(--pd-ink-3); }
.pd-attach-list { display: flex; flex-direction: column; gap: 6px; }
.pd-attach { display: flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid var(--pd-line); border-radius: 9px; padding: 8px 10px; font-size: 12px; }
.pd-attach a { color: var(--pd-blue); font-weight: 700; text-decoration: none; }
.pd-attach a:hover { text-decoration: underline; }

/* ---------- Emoji picker ---------- */
.pd-emoji-pop {
  position: fixed; z-index: 3500; background: #fff; border: 1px solid var(--pd-line);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(15,23,42,.22); padding: 8px;
  display: none; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 196px;
}
.pd-emoji-pop.show { display: grid; }
.pd-emoji-pop button { font-size: 22px; padding: 7px !important; border-radius: 9px; line-height: 1; }
.pd-emoji-pop button:hover { background: #eff6ff; transform: scale(1.12); }

/* ---------- Atividades ---------- */
.pd-act-list { display: flex; flex-direction: column; gap: 8px; }
.pd-act {
  display: flex; gap: 11px; background: #fff; border: 1px solid var(--pd-line);
  border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: .15s;
}
.pd-act:hover { border-color: #bfdbfe; box-shadow: 0 6px 18px rgba(15,23,42,.06); }
.pd-act.unread { background: #f8fbff; border-color: #dbeafe; }
.pd-act.unread::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pd-blue); margin-top: 6px; flex: 0 0 auto; }
.pd-act .pd-act-ico { width: 34px; height: 34px; border-radius: 10px; background: #eff6ff; display: grid; place-items: center; font-size: 16px; flex: 0 0 auto; }
.pd-act .pd-act-txt { flex: 1; min-width: 0; font-size: 12.5px; color: var(--pd-ink-2); line-height: 1.45; }
.pd-act .pd-act-txt b { color: var(--pd-ink); }
.pd-act .pd-act-time { font-size: 10.5px; color: var(--pd-ink-3); margin-top: 3px; }

/* ---------- Login ---------- */
.pd-login { display: grid; place-items: center; min-height: calc(100vh - 58px); padding: 20px; }
.pd-login-box { width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--pd-line); border-radius: 20px; padding: 28px; box-shadow: 0 24px 60px rgba(15,23,42,.12); }
.pd-login-logo { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; font-size: 26px; background: linear-gradient(135deg, #0a66c2, #0d8bd9); box-shadow: 0 10px 24px rgba(10,102,194,.35); margin-bottom: 14px; }
.pd-login-box h2 { margin: 0 0 4px; font-size: 20px; font-weight: 800; color: var(--pd-ink); }
.pd-login-box p { margin: 0 0 18px; font-size: 12.5px; color: var(--pd-ink-2); }
.pd-login-box .pd-field { margin-bottom: 11px; }
.pd-login-msg { font-size: 12px; color: var(--pd-red); min-height: 16px; margin: 4px 0 8px; }
.pd-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.pd-quick button { font-size: 11px; padding: 5px 9px !important; background: #f8fafc !important; border: 1px solid var(--pd-line) !important; color: var(--pd-ink-2) !important; }
.pd-quick button:hover { border-color: var(--pd-blue) !important; color: var(--pd-blue) !important; }

/* ---------- Admin ---------- */
.pd-tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--pd-line); margin-bottom: 16px; flex-wrap: wrap; }
.pd-tab { padding: 8px 13px !important; font-size: 12.5px; font-weight: 700; color: var(--pd-ink-3); border-radius: 9px 9px 0 0; border-bottom: 2px solid transparent !important; }
.pd-tab.active { color: var(--pd-blue); border-bottom-color: var(--pd-blue) !important; background: #eff6ff; }
.pd-admin-grid { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 16px; }
.pd-admin-list { display: flex; flex-direction: column; gap: 6px; }
.pd-admin-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--pd-line); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; }
.pd-admin-item:hover { border-color: #bfdbfe; }
.pd-admin-item.active { border-color: var(--pd-blue); background: #eff6ff; }
.pd-admin-item .pd-ai-name { font-size: 12.5px; font-weight: 700; color: var(--pd-ink); }
.pd-admin-item .pd-ai-sub { font-size: 10.5px; color: var(--pd-ink-3); }
.pd-perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px 12px; }
.pd-perm { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--pd-ink-2); background: #f8fafc; border: 1px solid var(--pd-line); border-radius: 8px; padding: 7px 9px; cursor: pointer; }
.pd-perm input { width: auto; }
.pd-perm.on { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.pd-group-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--pd-line); border-radius: 10px; background: #fff; margin-bottom: 7px; }
.pd-group-row .pd-gr-name { font-weight: 800; color: var(--pd-ink); font-size: 13px; }
.pd-group-row .pd-gr-sub { font-size: 11px; color: var(--pd-ink-3); }
.pd-group-row .pd-gr-actions { margin-left: auto; display: flex; gap: 5px; }
.pd-group-row .pd-gr-actions button { padding: 5px 8px !important; font-size: 11px; }

/* ---------- Financeiro ---------- */
.pd-fin-card { background: #fff; border: 1px solid var(--pd-line); border-radius: 14px; padding: 15px 17px; margin-bottom: 12px; }
.pd-fin-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; }
.pd-fin-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px 14px; }
.pd-fin-pay { margin-top: 12px; background: #f8fafc; border: 1px solid var(--pd-line); border-radius: 10px; padding: 11px 13px; }
.pd-fin-pay .pd-fp-title { font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--pd-ink-3); margin-bottom: 6px; }
.pd-fin-pay .pd-fp-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px 12px; }

/* ---------- Toast ---------- */
.pd-toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 5000; display: flex; flex-direction: column; gap: 8px; }
.pd-toast {
  background: #0f172a; color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 11px 15px; border-radius: 11px; box-shadow: 0 14px 40px rgba(15,23,42,.3);
  display: flex; align-items: center; gap: 8px; animation: pdToast .2s ease-out;
  max-width: 360px;
}
.pd-toast.ok { border-left: 3px solid #22c55e; }
.pd-toast.err { border-left: 3px solid #ef4444; }
@keyframes pdToast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .pd-order-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .pd-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pd-fin-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .pd-app { grid-template-columns: 1fr; }
  .pd-sidebar { position: relative; max-height: none; min-height: 0; }
  .pd-side-scroll { max-height: 300px; }
  .pd-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pd-form-grid .span-3 { grid-column: span 2; }
  .pd-detail-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pd-admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pd-content { padding: 14px; }
  .pd-order-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pd-form-grid { grid-template-columns: 1fr; }
  .pd-form-grid .span-2, .pd-form-grid .span-3 { grid-column: span 1; }
  .pd-detail-grid { grid-template-columns: 1fr; }
  .pd-perm-grid { grid-template-columns: 1fr; }
  .pd-stats { grid-template-columns: 1fr 1fr; }
  .pd-topbar { padding: 10px 12px; flex-wrap: wrap; }
  .pd-search { max-width: none; order: 3; flex-basis: 100%; }
  .pd-fin-grid, .pd-fin-pay .pd-fp-grid { grid-template-columns: 1fr; }
  .pd-group-row { flex-wrap: wrap; }
  .pd-group-row > div:nth-child(2) { flex-basis: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .pd-group-row .pd-gr-actions { margin-left: auto; }
}

/* ================= CHEGOU ISSO ================= */
.pd-chegou-resumo {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px;
  margin: 0 0 14px;
}
.pd-chegou-resumo > div {
  background: #fff; border: 1px solid var(--pd-line); border-radius: 12px; padding: 11px 13px;
}
.pd-chegou-resumo > div span { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--pd-ink-3); }
.pd-chegou-resumo > div b { display: block; font-size: 17px; color: var(--pd-ink); margin-top: 3px; }
.pd-chegou-resumo > div b.ok { color: var(--pd-green); }
.pd-chegou-resumo > div b.warn { color: var(--pd-amber); }

.pd-tabs-mini { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.pd-tabs-mini .pd-tab { font-size: 12px; padding: 7px 12px; }

.pd-table-wrap { background: #fff; border: 1px solid var(--pd-line); border-radius: 14px; overflow: auto; }
.pd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 720px; }
.pd-table thead th {
  text-align: left; font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  color: var(--pd-ink-3); padding: 10px 12px; border-bottom: 1px solid var(--pd-line); background: #f8fafc; white-space: nowrap;
}
.pd-table tbody td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; color: var(--pd-ink-2); vertical-align: middle; }
.pd-table tbody tr:last-child td { border-bottom: 0; }
.pd-table tbody tr:hover { background: #f8fafc; }
.pd-key-sm { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; color: var(--pd-ink); font-size: 12px; }
.pd-td-money { font-weight: 800; color: var(--pd-ink); white-space: nowrap; }
.pd-td-actions { text-align: right; white-space: nowrap; }
.pd-btn-xs { font-size: 11px !important; padding: 5px 9px !important; border-radius: 7px !important; }
.pd-tr-cancel td { background: #fef2f2 !important; color: #b91c1c; }
.pd-tr-cancel .pd-key-sm { color: #b91c1c; }
.pd-badge.cancelado { background: #fef2f2; color: #b91c1c; }
.pd-badge.aguardando { background: #fffbeb; color: #b45309; }
.pd-badge.baixado { background: #ecfdf5; color: #047857; }
.pd-badge.vinculado { background: #eff6ff; color: #1d4ed8; }

.pd-cam-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; }
.pd-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pd-photo {
  position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--pd-line); background: #f1f5f9;
}
.pd-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-photo button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0 !important;
  border-radius: 50% !important; background: rgba(15,23,42,.75) !important; color: #fff !important;
  font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.pd-photo-count {
  position: absolute; bottom: 4px; left: 4px; background: rgba(15,23,42,.75); color: #fff;
  font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 20px;
}
.pd-photos-big { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pd-photos-big a {
  display: block; width: 150px; height: 150px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--pd-line); background: #f1f5f9;
}
.pd-photos-big img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 860px) {
  .pd-chegou-resumo { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .pd-chegou-resumo { grid-template-columns: 1fr 1fr; }
  .pd-photo { width: 74px; height: 74px; }
  .pd-photos-big a { width: 100px; height: 100px; }
}

/* ================= ACESSO RESTRITO ================= */
.pd-sem-acesso { max-width: 560px; margin: 40px auto; }
.pd-sem-acesso h3 { color: #b91c1c; }
.pd-side-none { font-size: 10.5px; color: #64748b; padding: 4px 8px; }
.pd-count-ok { background: #0d9488 !important; color: #fff !important; }

/* ================= FINANCEIRO / PARCELAS ================= */
.pd-fin-saldo { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: #475569; margin: 4px 0 10px; }
.pd-fin-saldo b { font-weight: 800; }
.pd-fin-saldo b.ok { color: #047857; }
.pd-fin-saldo b.warn { color: #b45309; }
.pd-table-fin { min-width: 640px; }
.pd-table-fin td, .pd-table-fin th { padding: 7px 8px; font-size: 11.5px; }
.pd-table-fin input, .pd-table-fin select { padding: 4px 6px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 11.5px; }
.pd-tr-paga { background: #f0fdf4; }
.pd-anex-count { font-size: 10.5px; color: #0a66c2; font-weight: 700; margin-left: 4px; }

/* Chips de vencimento: 30d verde · 15d laranja · 7d vermelho · hoje preto */
.pd-venc { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; white-space: nowrap; border: 1px solid transparent; }
.pd-venc.venc-ok { background: #dcfce7; color: #15803d; border-color: #86efac; }
.pd-venc.venc-warn { background: #ffedd5; color: #c2410c; border-color: #fdba74; }
.pd-venc.venc-danger { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.pd-venc.venc-hoje { background: #0f172a; color: #fff; border-color: #0f172a; }
.pd-venc.venc-atraso { background: #7f1d1d; color: #fff; border-color: #7f1d1d; }
.pd-venc.venc-paga { background: #dcfce7; color: #15803d; }
.pd-venc.venc-none { background: #f1f5f9; color: #64748b; }

/* Calendário */
.pd-cal-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; font-size: 13px; }
.pd-cal-total { margin-left: auto; font-size: 12px; color: #475569; }
.pd-cal-total b { color: #047857; }
.pd-cal-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pd-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.pd-cal-dow { font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: #94a3b8; text-align: center; padding: 4px 0; }
.pd-cal-cell { min-height: 74px; background: #fff; border: 1px solid #e2e8f0; border-radius: 9px; padding: 5px; display: flex; flex-direction: column; gap: 3px; }
.pd-cal-cell.pd-cal-empty { background: transparent; border: none; }
.pd-cal-day { font-size: 11px; font-weight: 800; color: #475569; }
.pd-cal-hoje { outline: 2px solid #0a66c2; }
.pd-cal-cell.venc-ok { border-color: #86efac; }
.pd-cal-cell.venc-warn { border-color: #fdba74; }
.pd-cal-cell.venc-danger { border-color: #fca5a5; }
.pd-cal-cell.venc-hoje { border-color: #0f172a; }
.pd-cal-cell.venc-atraso { border-color: #7f1d1d; }
.pd-cal-items { display: flex; flex-direction: column; gap: 2px; }
.pd-cal-item { border: none; background: #eff6ff; color: #1d4ed8; border-radius: 5px; font-size: 9.5px; padding: 2px 4px; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-cal-item:hover { background: #dbeafe; }

/* Anexos de pagamento */
.pd-file-ico { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 28px; background: #f1f5f9; }
.pd-photo-x { position: absolute; top: 2px; right: 2px; border: none; background: rgba(15,23,42,.75); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; cursor: pointer; line-height: 1; }
.pd-photo { position: relative; }

/* ================= v2.2 — MENU MOBILE EM BLOCOS (Req. 1) ================= */
.pd-mobile-nav { display: none; }
@media (max-width: 860px) {
  .pd-mobile-nav {
    display: block;
    padding: 12px 12px 4px;
    background:
      linear-gradient(135deg, rgba(212,175,55,.10) 0%, rgba(212,175,55,0) 42%),
      linear-gradient(160deg, #0b2545 0%, #123a63 100%);
    border-bottom: 1px solid rgba(212,175,55,.35);
  }
  .pd-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 10px;
  }
  .pd-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 8px 4px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(212,175,55,.45);
    border-radius: 14px;
    color: #fff; cursor: pointer;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .pd-tile:hover { background: rgba(212,175,55,.16); border-color: #d4af37; }
  .pd-tile:active { transform: scale(.96); }
  .pd-tile.active { background: rgba(212,175,55,.24); border-color: #f0c75e; box-shadow: 0 0 0 2px rgba(240,199,94,.35) inset; }
  .pd-tile-ico { font-size: 24px; line-height: 1; }
  .pd-tile-lbl {
    font-size: 9.5px; font-weight: 700; letter-spacing: .2px;
    text-align: center; line-height: 1.15; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .pd-tile-key {
    position: absolute; top: 4px; right: 5px;
    font-size: 8px; font-weight: 800; color: #0b2545;
    background: #f0c75e; border-radius: 4px; padding: 1px 3px; line-height: 1.2;
  }
  .pd-tile-add { border-style: dashed; background: rgba(255,255,255,.03); }
  .pd-tile-add .pd-tile-ico { font-size: 22px; color: #f0c75e; }
}

/* ================= v2.2 — PAINEL DE NOTIFICAÇÕES (Req. 3) ================= */
.pd-notif-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 92vw;
  background: #fff; z-index: 4600;
  box-shadow: -18px 0 48px rgba(15,23,42,.22);
  transform: translateX(105%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
.pd-notif-panel.show { transform: none; }
.pd-notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(160deg, #0b2545, #123a63); color: #fff;
}
.pd-notif-head b { font-size: 14px; }
.pd-notif-head-actions { display: flex; gap: 6px; }
.pd-notif-head-actions button {
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
  color: #fff; border-radius: 8px; font-size: 11px; font-weight: 700;
  padding: 5px 8px; cursor: pointer;
}
.pd-notif-head-actions button:hover { background: rgba(255,255,255,.18); }
.pd-notif-list { flex: 1; overflow-y: auto; padding: 8px; }
.pd-notif {
  display: flex; gap: 10px; padding: 10px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; transition: background .12s;
}
.pd-notif:hover { background: #f1f5f9; }
.pd-notif.unread { background: #eff6ff; border-color: #bfdbfe; }
.pd-notif-ico { font-size: 18px; line-height: 1; }
.pd-notif-t { font-size: 12.5px; font-weight: 800; color: #0f172a; }
.pd-notif-x { font-size: 11.5px; color: #475569; margin-top: 2px; }
.pd-notif-time { font-size: 10px; color: #94a3b8; margin-top: 4px; }
.pd-notif-empty { text-align: center; color: #94a3b8; font-size: 12px; padding: 40px 12px; }

/* ================= v2.2 — LOGIN ================= */
.pd-login-shield {
  width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.pd-login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 4px; }
.pd-login-remember { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #e0f2fe; cursor: pointer; }
.pd-login-forgot { font-size: 12px; color: #fde68a; font-weight: 700; text-decoration: none; cursor: pointer; }
.pd-login-forgot:hover { text-decoration: underline; }
.pd-login-foot { text-align: center; font-size: 10.5px; color: rgba(255,255,255,.65); margin-top: 18px; }

/* ================= v2.2 — BUSCA (lupa à direita) ================= */
.pd-search { position: relative; }
.pd-search input { padding-right: 34px !important; }
.pd-search-ico {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 14px; opacity: .6; pointer-events: none;
}

/* ================= v2.2 — AVARIAS ================= */
.pd-av-item-head { display: grid; grid-template-columns: 1.1fr .9fr 2fr 90px auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.pd-av-item-head input { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 12px; min-width: 0; }
.pd-av-report h2 { font-size: 18px; margin: 0 0 14px; color: #0f172a; }
.pd-av-report h4 { font-size: 13px; margin: 18px 0 8px; color: #334155; }
@media (max-width: 640px) {
  .pd-av-item-head { grid-template-columns: 1fr 1fr; }
  .pd-av-item-head button { grid-column: span 2; }
}

/* ================= v2.2 — PAGAMENTOS E BOLETOS (Req. 6) ================= */
.pd-bol-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.pd-bol-filters input, .pd-bol-filters select {
  padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 9px; font-size: 12px; background: #fff;
}
.pd-bol-filters input#pdBolBusca { flex: 1; min-width: 220px; }
.pd-table-bol th, .pd-table-bol td { font-size: 11px; vertical-align: top; }
.pd-bol-alerta { border-radius: 11px; padding: 11px 14px; font-size: 12.5px; font-weight: 700; margin-bottom: 12px; border: 1px solid transparent; }
.pd-bol-alerta.venc-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pd-bol-alerta.venc-warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.pd-bol-alerta.venc-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.pd-bol-alerta.venc-hoje { background: #fef2f2; color: #7f1d1d; border-color: #fca5a5; animation: pdPulse 1.4s infinite; }
.pd-bol-alerta.venc-atraso { background: #7f1d1d; color: #fff; border-color: #991b1b; }
@keyframes pdPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.35); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
.pd-anex-chip { display: inline-block; font-size: 10px; background: #eff6ff; color: #1d4ed8; border-radius: 6px; padding: 2px 5px; margin: 1px; text-decoration: none; }
.pd-anex-del { border: none; background: #fee2e2; color: #b91c1c; border-radius: 4px; font-size: 9px; cursor: pointer; padding: 1px 4px; margin-left: 2px; }
.pd-bol-charts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-top: 16px; }
.pd-bol-chart { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; height: 260px; }
.pd-bol-chart h4 { margin: 0 0 8px; font-size: 12px; color: #334155; }
.pd-bol-chart canvas { max-height: 210px; }
@media (max-width: 860px) { .pd-bol-charts { grid-template-columns: 1fr; } }

/* ================= v2.3 — Chegou Isso: submenus BAIXA ================= */
.pd-chegou-item { display: flex; flex-direction: column; }
.pd-chegou-row { display: flex; align-items: stretch; gap: 2px; }
.pd-chegou-row .pd-side-item { flex: 1; min-width: 0; }
.pd-expand {
  flex: 0 0 auto; width: 26px; border: 0; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.06); color: #cbd5e1; font-size: 11px;
  display: grid; place-items: center; transition: background .15s, transform .2s;
}
.pd-expand:hover { background: rgba(255,255,255,.14); }
.pd-expand.open { transform: rotate(180deg); }
.pd-chegou-sub { display: none; margin: 2px 0 4px 18px; }
.pd-chegou-sub.open { display: block; }
.pd-side-sub {
  background: rgba(255,255,255,.07) !important; border: 1px solid rgba(148,163,184,.2) !important;
  color: #dbeafe !important; font-size: 11.5px !important; padding: 7px 9px !important;
}
#pdFinanceiroLojas { display: flex; flex-direction: column; gap: 5px; }
#pdFinanceiroLojas .pd-side-sub { width: 100%; text-align: left; display:flex; align-items:center; gap:9px; }
#pdFinanceiroLojas .pd-side-sub:hover { background: rgba(255,255,255,.13) !important; }
#pdFinanceiroLojas .pd-side-sub.active { background: rgba(10,102,194,.35) !important; border-color: rgba(96,165,250,.5) !important; }
.pd-finance-icon { display:inline-grid; place-items:center; width:24px; height:24px; flex:0 0 24px; border-radius:8px; background:rgba(34,197,94,.16); color:#86efac; font-weight:900; }
.pd-permissions-head,.pd-permission-group-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.pd-permissions-head { margin:14px 0 8px; color:#334155; font-size:13px; }
.pd-permission-group { margin:0 0 10px; padding:11px; border:1px solid #e2e8f0; border-radius:11px; background:#f8fafc; }
.pd-permission-group-head { margin-bottom:8px; color:#475569; font-size:11px; text-transform:uppercase; letter-spacing:.4px; }
.pd-permission-group-head .pd-btn-ghost,.pd-permissions-head .pd-btn-ghost { width:auto; padding:5px 9px; font-size:10px; }
.pd-baixa-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-user-edit-fields { display:block; min-width:0; margin:0; padding:0; border:0; }
.pd-user-edit-fields:disabled { opacity:.78; }
.pd-order-invoice-edit { margin-top:12px; padding:10px; border:1px solid #dbeafe; border-radius:10px; background:#f8fbff; }
.pd-order-invoice-edit label,.pd-order-invoice-edit small { display:block; color:#475569; font-size:11px; }
.pd-order-invoice-edit label { font-weight:800; margin-bottom:5px; }
.pd-order-invoice-edit > div { display:flex; gap:7px; }
.pd-order-invoice-edit input { flex:1; min-width:0; padding:8px 10px; border:1px solid #cbd5e1; border-radius:8px; }
.pd-order-invoice-edit small { margin-top:6px; }
.pd-purchase-card { background:#fff; border:1px solid #dbe4f0; border-radius:16px; padding:16px; margin:0 0 12px; box-shadow:0 5px 16px rgba(15,23,42,.045); }
.pd-purchase-card.is-sent { border-left:4px solid #16a34a; }
.pd-purchase-card.is-rejected { border-left:4px solid #dc2626; }
.pd-purchase-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.pd-purchase-number { color:#0f172a; font-size:17px; font-weight:800; margin-right:8px; }
.pd-order-meta { color:#64748b; font-size:12px; margin-top:7px; }
.pd-purchase-status { display:inline-flex; align-items:center; border-radius:99px; padding:5px 9px; font-size:11px; font-weight:800; background:#fff7ed; color:#b45309; }
.pd-purchase-status.sent { background:#dcfce7; color:#15803d; }
.pd-purchase-status.rejected { background:#fee2e2; color:#b91c1c; }
.pd-purchase-status.urgent { margin-left:6px; background:#fee2e2; color:#b91c1c; }
.pd-purchase-meta { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:15px 0 10px; }
.pd-purchase-meta > div { background:#f8fafc; border-radius:10px; padding:9px 11px; min-width:0; }
.pd-purchase-meta small { display:block; color:#94a3b8; font-size:9px; font-weight:800; letter-spacing:.5px; }
.pd-purchase-meta b { display:block; color:#334155; font-size:12px; margin-top:4px; overflow-wrap:anywhere; }
.pd-purchase-items { color:#475569; font-size:12px; margin:8px 0; }
.pd-purchase-items summary { cursor:pointer; font-weight:700; }
.pd-purchase-items ul { list-style:none; margin:8px 0 0; padding:0; }
.pd-purchase-items li { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:8px 0; border-bottom:1px solid #eef2f7; }
.pd-purchase-item-main { display:flex; align-items:flex-start; gap:9px; width:100%; min-width:0; }
.pd-purchase-item-copy { flex:1; min-width:0; }
.pd-purchase-item-image { flex:0 0 44px; width:44px; height:44px; object-fit:contain; border:1px solid #e2e8f0; border-radius:7px; background:#fff; }
.pd-purchase-items li > div { min-width:0; }
.pd-purchase-items li small { display:block; margin-top:3px; color:#64748b; font-size:10.5px; overflow-wrap:anywhere; }
.pd-purchase-items li > b { flex:0 0 auto; text-align:right; color:#334155; }
.pd-purchase-item-fiscal { margin-top:5px; color:#64748b; font-size:10px; }
.pd-purchase-item-fiscal summary { color:#2563a6; font-weight:700; cursor:pointer; }
.pd-purchase-item-fiscal small { margin-left:8px; }
.pd-purchase-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:12px; }
.pd-purchase-actions button { width:auto; }
.pd-purchase-actions button:disabled { opacity:.65; cursor:default; }
.pd-purchase-format { display:inline-flex; align-items:center; gap:6px; color:#64748b; font-size:11px; font-weight:700; }
.pd-purchase-format select { width:auto; min-width:90px; padding:7px 8px; border:1px solid #cbd5e1; border-radius:8px; background:#fff; color:#334155; }
.pd-purchase-stats { margin-top:12px; }
@media (max-width:720px) {
  .pd-purchase-meta { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .pd-purchase-card { padding:12px; }
  .pd-purchase-actions button { flex:1 1 auto; }
  .pd-purchase-items li { flex-direction:column; gap:5px; }
  .pd-purchase-item-main { align-items:flex-start; }
  .pd-purchase-items li > b { text-align:left; }
}
@media (max-width:560px) {
  .pd-side-scroll { max-height:220px; }
  .pd-content { padding:10px; }
  .pd-permission-group { padding:8px; }
  .pd-permission-group-head { align-items:flex-start; }
}

/* ================= v2.3 — Pagamentos e Boletos: layout compacto ================= */
.pd-bol-filters #pdBolBusca { flex: 0 0 auto; width: 30%; min-width: 150px; max-width: 280px; }
.pd-bol-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #475569; white-space: nowrap; }
.pd-bol-date span { color: #334155; }
.pd-bol-date input[type="date"] { width: 132px; padding: 7px 8px; font-size: 12px; }
.pd-bol-filters select { width: auto; max-width: 230px; padding: 7px 9px; font-size: 12px; }
.pd-bol-filters .pd-btn-xs { width: auto; }
.pd-bol-filters label { width: auto; }
.pd-bol-prev {
  background: #f8fafc; border: 1px solid #dbe4f0; border-radius: 12px;
  padding: 12px 14px; margin: 4px 0 12px;
}
.pd-bol-prev-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pd-bol-prev-head h4 { margin: 0; font-size: 13px; color: #1e293b; }
.pd-bol-prev-head .pd-badge { font-size: 11px; }
.pd-bol-prev-row {
  display: grid; grid-template-columns: 90px 1fr 90px 110px; gap: 8px;
  padding: 5px 0; border-top: 1px dashed #e2e8f0; font-size: 12px; color: #334155;
}
.pd-bol-prev-row b { color: #0f172a; }
.pd-bol-prev-row .money { text-align: right; font-weight: 800; color: #047857; }
.pd-bol-prev-more { font-size: 11.5px; color: #64748b; margin-top: 6px; }
.pd-bol-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.pd-bol-actions .pd-btn-primary { width: auto; }
.pd-bol-actions .pd-btn-ghost { width: auto; }
.pd-bol-empty { background: #eff6ff; border: 1px dashed #93c5fd; color: #1e40af; border-radius: 12px; padding: 16px; font-size: 13px; text-align: center; }
@media (max-width: 640px) {
  .pd-bol-filters #pdBolBusca { width: 100%; max-width: none; }
  .pd-bol-prev-row { grid-template-columns: 1fr 1fr; }
}

/* ===== v2.4 — 3ª aprovação, bloqueio de edição e exclusão ===== */
.pd-badge.aguardando { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.pd-fin-aprov { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 10px; padding: 8px 10px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; }
.pd-fin-aprov .pd-badge { font-size: 11px; }
.pd-lock-notice { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 12px; line-height: 1.5; }
.pd-locked, input.pd-locked, select.pd-locked, textarea.pd-locked { background: #f1f5f9 !important; color: #94a3b8 !important; cursor: not-allowed !important; opacity: .85; }
.pd-menu-pop button.danger { color: #dc2626; font-weight: 700; }
.pd-menu-pop button.danger:hover { background: #fef2f2; }

/* =====================================================================
   v2.5 — Tela de Sincronização (NFESync)
   ===================================================================== */
.nfe-sync-overlay {
  position: fixed; inset: 0; z-index: 99998;
  display: none; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px);
  padding: 16px;
}
.nfe-sync-overlay.show { display: flex; }
.nfe-sync-active #pdModals .pd-modal { z-index: 100060; }
.nfe-sync-card {
  width: 100%; max-width: 560px; max-height: 92vh; overflow: hidden;
  background: #fff; border-radius: 18px; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(2, 6, 23, .45);
  animation: nfeSyncIn .22s ease;
}
@keyframes nfeSyncIn { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.nfe-sync-head { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px 12px; border-bottom: 1px solid #e2e8f0; }
.nfe-sync-head-ico { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; font-size: 22px; background: #e0f2fe; border-radius: 12px; }
.nfe-sync-head h3 { margin: 0; font-size: 17px; font-weight: 800; color: #0f172a; }
.nfe-sync-head p { margin: 3px 0 0; font-size: 12px; color: #64748b; line-height: 1.4; }
.nfe-sync-x { border: 0; background: #f1f5f9; color: #64748b; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 15px; flex: 0 0 auto; }
.nfe-sync-x:hover { background: #e2e8f0; color: #0f172a; }
.nfe-sync-overall { display: flex; align-items: center; gap: 10px; padding: 12px 20px 4px; }
.nfe-sync-overall-bar { flex: 1; height: 9px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.nfe-sync-overall-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #0ea5e9, #22c55e); transition: width .18s ease; }
#nfeSyncOverallTxt { font-size: 12px; font-weight: 800; color: #0f172a; min-width: 40px; text-align: right; }
.nfe-sync-list { padding: 8px 20px 4px; overflow-y: auto; flex: 1; }
.nfe-sync-row { padding: 7px 0; opacity: .72; transition: opacity .2s; }
.nfe-sync-row.run, .nfe-sync-row.done { opacity: 1; }
.nfe-sync-line { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.nfe-sync-ico { font-size: 13px; }
.nfe-sync-lbl { color: #0f172a; font-weight: 600; white-space: nowrap; }
.nfe-sync-dots { flex: 1; border-bottom: 2px dotted #cbd5e1; margin: 0 4px 3px; min-width: 12px; }
.nfe-sync-pct { font-weight: 800; color: #0a66c2; font-variant-numeric: tabular-nums; }
.nfe-sync-row.done .nfe-sync-pct { color: #16a34a; }
.nfe-sync-bar { height: 6px; background: #eef2f7; border-radius: 99px; overflow: hidden; margin: 5px 0 2px; }
.nfe-sync-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #38bdf8, #0ea5e9); transition: width .12s linear; }
.nfe-sync-row.done .nfe-sync-bar i { background: linear-gradient(90deg, #4ade80, #16a34a); }
.nfe-sync-status { font-size: 10.5px; color: #94a3b8; }
.nfe-sync-status.run { color: #0ea5e9; }
.nfe-sync-status.ok { color: #16a34a; font-weight: 700; }
.nfe-sync-done { text-align: center; padding: 14px 20px 6px; }
.nfe-sync-done-ico { font-size: 40px; animation: nfePop .35s ease; }
@keyframes nfePop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.nfe-sync-done-txt { font-size: 18px; font-weight: 900; color: #16a34a; letter-spacing: -.2px; }
.nfe-sync-done-sub { font-size: 12px; color: #64748b; margin-top: 3px; }
.nfe-sync-err { margin: 8px 20px; padding: 10px 12px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px; font-size: 12px; line-height: 1.45; }
.nfe-sync-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid #e2e8f0; flex-wrap: wrap; }
.nfe-sync-btn { border: 0; border-radius: 10px; padding: 10px 18px; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.nfe-sync-btn.primary { background: #0a66c2; color: #fff; }
.nfe-sync-btn.primary:hover { background: #0857a6; }
.nfe-sync-btn.primary:disabled { opacity: .6; cursor: default; }
.nfe-sync-btn.ghost { background: #f1f5f9; color: #334155; }
.nfe-sync-btn.ghost:hover { background: #e2e8f0; }

/* Atalho "Sincronizar" ao lado de Configuração */
.nav-sync-btn { background: linear-gradient(135deg, #0ea5e9, #0a66c2) !important; color: #fff !important; border-color: transparent !important; font-weight: 700; }
.nav-sync-btn:hover { filter: brightness(1.06); }
.nav-sync-btn.spin .nav-sync-ico { display: inline-block; animation: nfeSpin 1s linear infinite; }
@keyframes nfeSpin { to { transform: rotate(360deg); } }

/* =====================================================================
   v2.5 — Produtos do pedido (Lançar pedido)
   ===================================================================== */
.pd-prod-search { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pd-prod-search input { flex: 1; min-width: 200px; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 9px; font-size: 12.5px; }
.pd-prod-sug { display: none; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; margin-bottom: 10px; max-height: 240px; overflow-y: auto; }
.pd-prod-sug.show { display: block; }
.pd-prod-sug button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 9px 12px; font-size: 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.pd-prod-sug button:hover { background: #f0f9ff; }
.pd-prod-sug .sug-desc { font-weight: 700; color: #0f172a; }
.pd-prod-sug .sug-meta { font-size: 10.5px; color: #64748b; }
.pd-prod-sug .sug-empty { padding: 12px; font-size: 12px; color: #94a3b8; text-align: center; }
.pd-prod-table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; }
.pd-prod-table { width: 100%; border-collapse: collapse; font-size: 11.5px; min-width: 720px; }
.pd-prod-table th { background: #f8fafc; color: #475569; font-weight: 700; text-align: left; padding: 8px 7px; border-bottom: 1px solid #e2e8f0; white-space: nowrap; font-size: 10.5px; text-transform: uppercase; letter-spacing: .02em; }
.pd-prod-table td { padding: 6px 7px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: #0f172a; }
.pd-prod-table tr:last-child td { border-bottom: 0; }
.pd-prod-table tr.recusado td { opacity: .5; }
.pd-prod-table tr.recusado .pd-prod-desc { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: #dc2626; }
.pd-prod-table input { width: 100%; min-width: 58px; padding: 5px 6px; border: 1px solid #e2e8f0; border-radius: 7px; font-size: 11.5px; text-align: right; background: #fff; }
.pd-prod-table input:focus { border-color: #0ea5e9; outline: none; box-shadow: 0 0 0 2px rgba(14,165,233,.15); }
.pd-prod-table input.pd-prod-qtd { text-align: center; font-weight: 700; }
.pd-prod-desc { max-width: 240px; }
.pd-prod-desc .pd-prod-name { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
.pd-prod-cod { font-family: ui-monospace, monospace; font-size: 10.5px; color: #475569; }
.pd-prod-actions { display: flex; gap: 4px; }
.pd-prod-actions button { border: 1px solid #e2e8f0; background: #fff; border-radius: 7px; width: 26px; height: 26px; cursor: pointer; font-size: 12px; display: grid; place-items: center; padding: 0; }
.pd-prod-actions button.rej:hover, .pd-prod-actions button.rej.active { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.pd-prod-actions button.cmt:hover, .pd-prod-actions button.cmt.active { background: #eff6ff; border-color: #bfdbfe; color: #0a66c2; }
.pd-prod-comment-row td { background: #f8fafc; padding: 6px 8px 10px; }
.pd-prod-comment-row textarea { width: 100%; min-height: 44px; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 11.5px; resize: vertical; }
.pd-prod-comment-view { margin-top: 5px; font-size: 11px; color: #0a66c2; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 7px; padding: 5px 8px; }
.pd-prod-empty { padding: 14px; text-align: center; color: #94a3b8; font-size: 12px; }
.pd-prod-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pd-prod-total { font-size: 12px; color: #0f172a; font-weight: 700; }

/* =====================================================================
   v2.6 — Ajustes de layout (atalhos, permissões, voltar, aprovação)
   ===================================================================== */

/* --- Atalhos (tiles) menores, quadrados e com texto branco --- */
.pd-tile-grid { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)) !important; gap: 8px !important; }
.pd-tile { aspect-ratio: 1 / 1 !important; gap: 3px !important; padding: 5px 3px !important; border-radius: 11px !important; }
.pd-tile-ico { font-size: 22px !important; }
.pd-tile-lbl {
  font-size: 8px !important; color: #fff !important; font-weight: 700 !important;
  letter-spacing: 0 !important; line-height: 1.1 !important;
  -webkit-line-clamp: 2 !important;
}
.pd-tile-key { font-size: 7px !important; padding: 0 3px !important; }

/* --- Caixas de seleção / permissões: centralizadas e menores --- */
.pd-perm-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)) !important; justify-content: center; }
.pd-perm {
  justify-content: center !important; text-align: center !important;
  font-size: 11px !important; min-height: 30px !important;
  padding: 5px 7px !important; gap: 5px !important;
}
.pd-perm input { width: 13px !important; height: 13px !important; margin: 0 !important; }

/* --- Aprovação: círculo verde (2 👍) / vermelho (reprovado ou pendente) --- */
.pd-order.pd-vote-aprovado {
  border: 2px solid #16a34a !important;
  box-shadow: 0 0 0 3px rgba(22,163,74,.18) !important;
}
.pd-order.pd-vote-reprovado,
.pd-order.pd-vote-pendente {
  border: 2px solid #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.16) !important;
}

/* --- Resumo de aprovação no detalhe --- */
.pd-aprov-resumo {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; padding: 9px 12px; border-radius: 10px;
  font-size: 12px; margin: 0 0 10px; border: 1px solid;
}
.pd-aprov-resumo b { font-size: 12.5px; }
.pd-aprov-resumo span { font-size: 11px; opacity: .85; }
.pd-aprov-resumo.aprovado { background: #ecfdf5; border-color: #86efac; color: #15803d; }
.pd-aprov-resumo.reprovado { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }
.pd-aprov-resumo.pendente { background: #fffbeb; border-color: #fcd34d; color: #b45309; }

/* --- Avisar chegada: vínculo automático da nota --- */
.pd-ci-linkinfo {
  display: none; margin-top: 6px; padding: 7px 10px; border-radius: 8px;
  font-size: 11.5px; line-height: 1.35; border: 1px solid;
}
.pd-ci-linkinfo.ok { display: block; background: #ecfdf5; border-color: #86efac; color: #15803d; }
.pd-ci-linkinfo.warn { display: block; background: #fffbeb; border-color: #fcd34d; color: #b45309; }

/* --- BAIXA: barra de filtros e ações --- */
.pd-baixa-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 9px 11px;
}
.pd-baixa-filters { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; flex: 1 1 320px; }
.pd-baixa-filters input {
  font-size: 11.5px; padding: 6px 9px; border: 1px solid #cbd5e1;
  border-radius: 8px; background: #fff; min-width: 0;
}
/* v2.7: busca com ~10cm e datas no tamanho do calendário */
.pd-baixa-filters input#pdBaixaBusca { flex: 0 0 378px; width: 378px; max-width: 100%; min-width: 220px; }
.pd-baixa-filters input#pdBaixaDe,
.pd-baixa-filters input#pdBaixaAte { flex: 0 0 150px; width: 150px; }
.pd-baixa-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* --- Produtos: célula de total por item e totais do pedido --- */
.pd-prod-total-cell { white-space: nowrap; text-align: right; }
.pd-prod-unit { display: block; font-size: 9.5px; color: #64748b; font-weight: 600; }
.pd-prod-total { display: block; font-size: 12px; color: #0f172a; font-weight: 800; }
.pd-prod-tot-line {
  display: flex; justify-content: space-between; gap: 14px;
  font-size: 11.5px; color: #334155; padding: 2px 0;
}
.pd-prod-tot-line b { font-weight: 800; color: #0f172a; }
.pd-prod-tot-final {
  border-top: 1px solid #cbd5e1; margin-top: 4px; padding-top: 5px;
  font-size: 12.5px; font-weight: 800; color: #0b2545;
}
.pd-prod-tot-final b { font-size: 13.5px; color: #0b2545; }
.pd-prod-tot-count { font-size: 10px; color: #94a3b8; text-align: right; margin-top: 2px; }

/* --- Menu topo (v2.6) --- */


/* ===== v2.7: botão Voltar dentro das janelas ===== */
.pd-back-btn { margin-right: auto; }
.pd-modal-foot .pd-back-btn { order: -1; }

/* ===== v2.7: coluna de imagem do produto ===== */
.pd-prod-img { width: 54px; text-align: center; }
.pd-prod-imgbox {
  width: 42px; height: 42px; border-radius: 8px; overflow: hidden;
  border: 1px dashed #cbd5e1; background: #f8fafc; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer;
}
.pd-prod-imgbox:hover { border-color: #0a66c2; }
.pd-prod-imgbox img { width: 100%; height: 100%; object-fit: cover; }
.pd-prod-imgph { font-size: 17px; opacity: .55; }

/* ===== v2.7: sugestões de razão social ===== */
.pd-sug { position: relative; }
.pd-sug.show {
  display: block; position: absolute; z-index: 60; left: 0; right: 0; top: 100%;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; margin-top: 2px;
  box-shadow: 0 8px 24px rgba(15,23,42,.14); max-height: 220px; overflow: auto;
}
.pd-sug-item { padding: 7px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.pd-sug-item:hover { background: #eff6ff; }
.pd-sug-item span { color: #64748b; font-size: 11.5px; }

/* ===== v2.7: cartão flutuante de mensagem (6cm x 4cm) ===== */
.pd-msg-card {
  position: fixed; right: 16px; bottom: 16px; z-index: 99999;
  width: 6cm; height: 4cm; box-sizing: border-box;
  background: #0b2a5b; color: #fff;
  border: 2px solid #ffffff; border-radius: 12px;
  box-shadow: 0 14px 40px rgba(2, 12, 32, .45);
  padding: 7px 9px; display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; animation: pdMsgIn .25s ease-out;
}
@keyframes pdMsgIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.pd-msg-card-x {
  position: absolute; top: 4px; right: 6px; background: transparent; border: 0;
  color: #cbd5e1; font-size: 13px; cursor: pointer; line-height: 1;
}
.pd-msg-card-x:hover { color: #fff; }
.pd-msg-card-head { font-size: 10.5px; font-weight: 700; color: #dbeafe; padding-right: 16px; line-height: 1.25; }
.pd-msg-card-text { flex: 1; overflow: hidden; font-size: 11px; color: #fff; line-height: 1.25; }
.pd-msg-card-reply { display: flex; gap: 4px; }
.pd-msg-card-reply input {
  flex: 1; min-width: 0; border: 1px solid #ffffff66; background: #ffffff1a;
  color: #fff; border-radius: 6px; padding: 3px 6px; font-size: 10.5px; outline: none;
}
.pd-msg-card-reply input::placeholder { color: #cbd5e1; }
.pd-msg-card-reply button {
  border: 0; background: #22c55e; color: #04220f; font-weight: 800;
  border-radius: 6px; padding: 3px 8px; font-size: 10.5px; cursor: pointer;
}

/* Conversa compartilhada por loja */
.pd-store-chat {
  margin-top: 20px; border: 1px solid #dbe3ee; border-radius: 12px;
  background: #fff; overflow: hidden; box-shadow: 0 3px 12px rgba(15, 23, 42, .05);
}
.pd-store-chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.pd-store-chat-head div { display: flex; flex-direction: column; gap: 3px; }
.pd-store-chat-head b { color: #0f172a; font-size: 14px; }
.pd-store-chat-head span { color: #64748b; font-size: 11px; }
.pd-store-chat-count {
  min-width: 24px; padding: 3px 7px; border-radius: 20px;
  background: #dbeafe; color: #1d4ed8 !important; text-align: center; font-weight: 800;
}
.pd-store-chat-list {
  min-height: 120px; max-height: 340px; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 9px;
}
.pd-store-chat-message {
  align-self: flex-start; max-width: min(85%, 680px); padding: 8px 10px;
  border: 1px solid #e2e8f0; border-radius: 10px 10px 10px 2px;
  background: #f8fafc; overflow-wrap: anywhere;
}
.pd-store-chat-message.mine {
  align-self: flex-end; border-color: #bfdbfe; border-radius: 10px 10px 2px 10px;
  background: #eff6ff;
}
.pd-store-chat-author { color: #64748b; font-size: 10px; margin-bottom: 4px; }
.pd-store-chat-text { white-space: pre-wrap; font-size: 13px; line-height: 1.4; }
.pd-store-chat-text.bold { font-weight: 800; }
.pd-store-chat-text.italic { font-style: italic; }
.pd-store-chat-image img { display: block; max-width: min(100%, 280px); max-height: 220px; margin-top: 7px; border-radius: 7px; }
.pd-store-chat-attachment-link { display: inline-block; margin-top: 6px; color: #1d4ed8; font-size: 12px; }
.pd-store-chat-empty { padding: 32px 8px; color: #94a3b8; font-size: 12px; text-align: center; }
.pd-store-chat-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 8px 10px 4px; }
.pd-store-chat-tools button, .pd-store-chat-tools label {
  min-height: 30px; border: 1px solid #dbe3ee; border-radius: 6px;
  background: #fff; color: #334155; padding: 4px 7px; font-size: 13px; cursor: pointer;
}
.pd-store-chat-tools button.active { background: #dbeafe; border-color: #60a5fa; color: #1d4ed8; }
.pd-store-chat-tools label { display: inline-flex; align-items: center; gap: 4px; }
.pd-store-chat-tools input[type="color"] { width: 23px; height: 21px; padding: 0; border: 0; }
.pd-store-chat-emojis { display: flex; gap: 3px; }
.pd-store-chat-file { font-size: 16px !important; }
.pd-store-chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 5px 10px 10px; }
.pd-store-chat-compose textarea {
  flex: 1; min-width: 0; resize: vertical; border: 1px solid #cbd5e1;
  border-radius: 8px; padding: 8px; font: inherit; font-size: 13px;
}
.pd-store-chat-attachment { padding: 0 12px 8px; color: #475569; font-size: 11px; }
.pd-store-chat-attachment[hidden] { display: none; }
.pd-store-chat-attachment button { margin-left: 6px; border: 0; background: transparent; color: #b91c1c; cursor: pointer; }
.pd-tile-wrap { position: relative; min-width: 0; }
.pd-tile-wrap > .pd-tile { width: 100%; height: 100%; }
.pd-tile-remove {
  position: absolute; z-index: 3; top: 3px; left: 3px;
  display: none; place-items: center; width: 25px; height: 25px;
  padding: 0; border: 1px solid #fecaca; border-radius: 7px;
  background: #fff1f2; color: #b91c1c; font-size: 14px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.pd-tile-wrap.delete-ready > .pd-tile-remove { display: grid; }
.pd-tile-wrap.delete-ready > .pd-tile { border-color: #f87171; }
@media (max-width: 600px) {
  .pd-store-chat-compose { align-items: stretch; }
  .pd-store-chat-compose .pd-btn-primary { padding: 7px 9px; }
  .pd-store-chat-emojis { width: 100%; }
}
.pd-content.has-store-chat { padding-right: 10px; padding-bottom: 40px; }
.pd-content.has-store-chat.store-chat-expanded { padding-bottom: 48vh; }
.pd-content.has-store-chat.store-chat-expanded { padding-right:10px; }
.pd-content.has-store-chat.store-chat-expanded { padding-right: 380px; }
.pd-store-chat {
  position: fixed; z-index: 1200; right: 12px; top: 150px; bottom: 12px;
  width: 350px; max-width: calc(100vw - 24px); height: auto; margin: 0;
  display: flex; flex-direction: column;
}
.pd-store-chat-head { flex: 0 0 auto; padding: 9px 10px; }
.pd-store-chat-head b { font-size: 13px; }
.pd-store-chat-head span { font-size: 10px; }
.pd-store-chat-collapsed-title { display:none; }
.pd-store-chat-head .pd-store-chat-presence { color: #16a34a; }
.pd-store-chat-toggle { min-width: 28px !important; min-height: 28px !important; padding: 0 !important; font-size: 18px !important; }
.pd-store-chat-list { flex: 1 1 auto; min-height: 100px; max-height: none; padding: 12px 10px; }
.pd-store-chat-row { display: flex; align-items: flex-end; gap: 7px; max-width: 100%; }
.pd-store-chat-row.mine { flex-direction: row-reverse; }
.pd-store-chat-avatar { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #dbeafe; font-size: 16px; }
.pd-store-chat-row.mine .pd-store-chat-avatar { background: #dcfce7; }
.pd-store-chat-message { max-width: calc(100% - 38px); padding: 9px 11px; border: 0; border-radius: 14px 14px 14px 4px; background: #eaf2ff; }
.pd-store-chat-message.mine { border-radius: 14px 14px 4px 14px; background: #e9f8ee; }
.pd-store-chat-author { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #2563eb; }
.pd-store-chat-author b { font-size: 11px; }
.pd-store-chat-row.mine .pd-store-chat-author { color: #16803c; }
.pd-store-chat-author time { flex: 0 0 auto; color: #64748b; font-size: 9px; }
.pd-store-chat-text { font-size: 12px; }
.pd-store-chat-tools { position: relative; flex: 0 0 auto; }
.pd-store-chat-emoji-pop {
  position: absolute; z-index: 1202; right: 10px; bottom: 62px;
  width: min(320px, calc(100% - 20px)); max-height: 230px; overflow: hidden; padding: 6px;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .2);
}
.pd-store-chat-emoji-pop[hidden] { display: none; }
.pd-store-chat-emoji-pop nav { display: flex; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid #e2e8f0; }
.pd-store-chat-emoji-pop nav button { flex: 1; min-width: 28px; min-height: 29px; padding: 2px !important; }
.pd-store-chat-emoji-sections { max-height: 184px; overflow: auto; }
.pd-store-chat-emoji-sections section[hidden] { display: none; }
.pd-store-chat-emoji-sections section > b { display: block; padding: 6px 2px 3px; font-size: 10px; color: #334155; }
.pd-store-chat-emoji-sections section > div { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.pd-store-chat-emoji-sections section > div button { min-width: 28px; min-height: 30px; padding: 2px !important; }
.pd-store-chat-tools {
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 5px;
  padding: 6px 8px; border-top: 1px solid #e2e8f0;
  scrollbar-width: thin;
}
.pd-store-chat-tools > button,
.pd-store-chat-tools > .pd-store-chat-file,
.pd-store-chat-tools > label { flex: 0 0 auto; }
.pd-store-chat-compose { align-items: flex-end; gap: 5px; padding: 6px 8px 8px; }
.pd-store-chat-compose textarea {
  min-height: 40px; max-height: 120px; padding: 8px; font-size: 11px;
  resize: none; overflow-y: auto;
}
.pd-store-chat-compose .pd-btn-primary { min-width: 38px; min-height: 40px; padding: 5px !important; border-radius: 10px; }
.pd-store-chat-compose > button:not(.pd-btn-primary),
.pd-store-chat-compose .pd-store-chat-file { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 38px; border: 1px solid #dbe3ee; border-radius: 9px; background: #fff; }
.pd-store-chat-tools button, .pd-store-chat-tools label { min-height: 32px; padding: 3px 8px; font-size: 12px; }
.pd-store-chat.is-collapsed { top:auto; right:12px; bottom:12px; left:auto; width:150px; height:40px; max-width:calc(100vw - 24px); border-radius:11px; }
.pd-store-chat.is-collapsed > :not(.pd-store-chat-head) { display: none; }
.pd-store-chat.is-collapsed .pd-store-chat-head { height:40px; gap:7px; padding:4px 8px; border:0; }
.pd-store-chat.is-collapsed .pd-store-chat-head div { flex:1; min-width:0; }
.pd-store-chat.is-collapsed .pd-store-chat-title,
.pd-store-chat.is-collapsed .pd-store-chat-presence { display:none; }
.pd-store-chat.is-collapsed .pd-store-chat-head .pd-store-chat-collapsed-title { display:inline; color:#0f172a; font-size:12px; white-space:nowrap; }
.pd-store-chat.is-collapsed .pd-store-chat-count { min-width:21px; padding:2px 6px; font-size:10px; }
.pd-store-chat.is-collapsed .pd-store-chat-toggle { min-width:24px !important; min-height:24px !important; font-size:16px !important; }
@media (max-width: 760px) {
  .pd-content.has-store-chat { padding-right: 10px; padding-bottom: 40px; }
  .pd-content.has-store-chat.store-chat-expanded { padding-bottom: 48vh; }
  .pd-store-chat { top: auto; right: 8px; bottom: 8px; left: 8px; width: auto; height: 45vh; max-width: none; }
  .pd-store-chat.is-collapsed { left:auto; right:8px; width:min(150px, calc(100vw - 16px)); height:40px; }
}
.pd-purchase-item-total { flex:0 0 auto; align-self:center; color:#334155; text-align:right; }
.pd-fin-note-toolbar { display: flex; align-items: end; gap: 10px; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; }
.pd-fin-note-toolbar label { display: grid; gap: 4px; min-width: min(320px, 100%); color: #475569; font-size: 11px; font-weight: 700; }
.pd-fin-note-toolbar input { min-height: 36px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 7px 10px; font: inherit; }
.pd-fin-note[hidden] { display: none; }
.pd-fin-note-no-results[hidden] { display: none; }
.pd-modal.pd-nfe-inspector { padding: 12px; }
.pd-modal.pd-nfe-inspector .pd-modal-box { width: min(96vw, 1500px); max-width: none; max-height: 94vh; }
.pd-nfe-inspector-meta { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 20px; color: #475569; font-size: 11px; }
.pd-nfe-inspector-table { overflow: auto; max-height: calc(94vh - 190px); margin: 0 20px; border: 1px solid #dbe3ee; border-radius: 8px; }
.pd-nfe-inspector-table table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 10px; }
.pd-nfe-inspector-table th, .pd-nfe-inspector-table td { padding: 6px 7px; border: 1px solid #e2e8f0; text-align: left; white-space: nowrap; }
.pd-nfe-inspector-table th { position: sticky; top: 0; z-index: 1; background: #f1f5f9; color: #334155; font-size: 9px; }
.pd-nfe-item-image, .pd-nfe-item-image-empty { display: inline-grid; place-items: center; width: 38px; height: 38px; object-fit: contain; border-radius: 5px; background: #f1f5f9; }
.pd-modal-x { margin-left: auto; border: 0; background: #f1f5f9; border-radius: 8px; width: 32px; height: 32px; font-size: 20px; cursor: pointer; }
.pd-nfe-inspector .pd-modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px 8px; }
@media (max-width: 600px) {
  .pd-fin-note-toolbar { align-items: stretch; }
  .pd-fin-note-toolbar label { min-width: 100%; }
  .pd-nfe-inspector-table { margin: 0 10px; }
}
.pd-stats {
  display: flex; flex-wrap: nowrap; gap: 7px; overflow-x: auto;
  margin-bottom: 12px; padding: 1px 1px 5px; scrollbar-width: thin;
}
.pd-stat {
  flex: 1 0 122px; min-width: 122px; min-height: 54px;
  gap: 7px; padding: 7px 9px; border-radius: 9px;
}
.pd-stat .pd-stat-ico { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; font-size: 14px; }
.pd-stat .pd-stat-num { font-size: 16px; white-space: nowrap; }
.pd-stat .pd-stat-lbl { font-size: 8px; letter-spacing: .2px; line-height: 1.15; }
.pd-chegou-resumo {
  display: flex; flex-wrap: nowrap; gap: 7px; overflow-x: auto;
  margin: 0 0 10px; padding: 1px 1px 5px; scrollbar-width: thin;
}
.pd-chegou-resumo > div { flex: 1 0 122px; min-width: 122px; padding: 7px 9px; border-radius: 9px; }
.pd-chegou-resumo > div span { font-size: 8px; letter-spacing: .2px; white-space: nowrap; }
.pd-chegou-resumo > div b { font-size: 15px; margin-top: 2px; white-space: nowrap; }
.pd-chegou-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 4px; scrollbar-width: thin; }
.pd-chegou-tabs .pd-tab { flex: 0 0 auto; padding: 6px 9px !important; font-size: 10px; white-space: nowrap; }
@media (max-width: 560px) {
  .pd-stats { display: flex; flex-wrap: nowrap; }
  .pd-stat { flex: 0 0 122px; }
  .pd-chegou-resumo { display: flex; }
  .pd-chegou-resumo > div { flex: 0 0 122px; }
}
.pd-fin-notes { display: grid; gap: 10px; }
.pd-fin-note-import { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.pd-fin-note { padding: 12px; border: 1px solid #dbe3ee; border-radius: 10px; background: #fff; }
.pd-fin-note-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pd-fin-note-top > div { display: grid; gap: 4px; min-width: 0; }
.pd-fin-note-top > div span { color: #64748b; font-size: 10px; overflow-wrap: anywhere; }
.pd-fin-note-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; color: #475569; font-size: 11px; }
.pd-fin-note-meta a { color: #1d4ed8; }
.pd-fin-note-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
