/* B4 Romaneio-like auth theme (light card + dark header bar)
   Scoped to body.b4-auth to avoid affecting the rest of the app. */

:root{
  --b4-auth-bg:#f2f3f5;
  --b4-auth-card:#ffffff;
  --b4-auth-primary:#445867;      /* header + primary button */
  --b4-auth-primary-2:#3b4d5a;    /* hover */
  --b4-auth-text:#1e2a32;
  --b4-auth-muted:#6b7a86;
  --b4-auth-border:#d7dde2;
  --b4-auth-shadow:0 10px 28px rgba(17, 24, 39, .18);
  --b4-auth-radius:14px;
}

html, body.b4-auth{height:100%;}

/* Page background + centering */
body.b4-auth{
  min-height: 100vh;
  margin: 0;
  background: var(--b4-auth-bg);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px 12px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--b4-auth-text);
}

/* Reset link style from global style.css */
body.b4-auth a{
  color: var(--b4-auth-muted);
  text-decoration: none;
}
body.b4-auth a:hover{
  background: transparent !important;
  text-decoration: underline;
}

/* Card */
.b4-auth-card{
  width: min(420px, 100%);
  background: var(--b4-auth-card);
  border-radius: var(--b4-auth-radius);
  margin: 0 auto;
  box-shadow: var(--b4-auth-shadow);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.03);
}

/* Header bar */
.b4-auth-header{
  background: var(--b4-auth-primary);
  color: #fff;
  padding: 14px 16px;
  display: flex !important;
  align-items: center !important;
  gap: 12px;
}
.b4-auth-header .b4-auth-icon{
  width: 28px;
  height: 28px;
  display: inline-block;
}
.b4-auth-header .b4-auth-title{
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* Body */
.b4-auth-body{
  padding: 18px 18px 14px;
}

.b4-auth-body .b4-auth-help{
  color: var(--b4-auth-muted);
  font-size: 13px;
  margin: 0 0 12px 0;
}

/* Form */
.b4-form-group{
  margin-bottom: 14px;
}
.b4-label{
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--b4-auth-text);
}
.b4-input{
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--b4-auth-border);
  border-radius: 10px;
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
}
.b4-input::placeholder{
  color: #9aa6b2;
}
.b4-input:focus{
  border-color: rgba(68, 88, 103, .75);
  box-shadow: 0 0 0 3px rgba(68, 88, 103, .14);
}

/* Button */
.b4-btn{
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--b4-auth-primary);
  color: #fff;
  font-weight: 700;
  padding: 12px 14px;
  font-size: 14px;
  cursor: pointer;
}
.b4-btn:hover{
  background: var(--b4-auth-primary-2);
}

/* Secondary button (WhatsApp, etc.) */
.b4-btn-secondary{
  margin-top: 10px;
  background: #6c7a87;
}
.b4-btn-secondary:hover{
  background: #5e6b77;
}

/* Footer links */
.b4-auth-footer{
  padding: 0 18px 16px;
  display: flex !important;
  justify-content: flex-start;
  gap: 10px;
  font-size: 13px;
}

/* Alert / error */
.b4-alert,
.b4-auth-alert{
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  background: #d9534f;
  color: #fff;
}

/* Desktop refinements */
@media (min-width: 992px){
  body.b4-auth{ padding: 40px 16px; }
  .b4-auth-card{ width: 540px; }
  .b4-auth-header{ padding: 16px 18px; }
  .b4-auth-header .b4-auth-title{ font-size: 18px; }
  .b4-auth-body{ padding: 22px 22px 14px; }
  .b4-auth-footer{ padding: 0 22px 18px; }
  .b4-input{ padding: 13px 14px; font-size: 15px; }
  .b4-label{ font-size: 14px; }
  .b4-btn{ padding: 13px 16px; font-size: 15px; }
}

/* Mobile-first refinements */
@media (max-width: 420px){
  body.b4-auth{ padding: 18px 10px; }
  .b4-auth-body{ padding: 16px 14px 12px; }
  .b4-auth-footer{ padding: 0 14px 14px; }
  .b4-auth-header{ padding: 12px 14px; }
  .b4-auth-header .b4-auth-title{ font-size: 16px; }
  .b4-input{ padding: 11px 12px; font-size: 14px; }
  .b4-label{ font-size: 13px; }
  .b4-btn{ padding: 12px 14px; }
}


/* --------------------------------------------------------------------------
   B4 UI theme for the rest of the app (Bootstrap + Bulma pages)
   Goal: keep layouts intact, but unify colors, rounded corners, and form UX.
   Scoped to body.b4-ui.
----------------------------------------------------------------------------*/

html, body.b4-ui{ height: 100%; }

body.b4-ui{
  min-height: 100vh;
  margin: 0;
  background: var(--b4-auth-bg);
  color: var(--b4-auth-text);
  font-family: Arial, Helvetica, sans-serif;
}

/* Generic page spacing */
body.b4-ui .container,
body.b4-ui .container-fluid{
  padding-left: 12px;
  padding-right: 12px;
}

/* Bulma container helpers */
body.b4-ui .container.is-max-desktop{
  max-width: 980px;
  margin: 0 auto;
}

/* Cards / panels (Bootstrap card + Bulma box/notification) */
body.b4-ui .card,
body.b4-ui .box,
body.b4-ui .notification{
  border-radius: var(--b4-auth-radius);
  box-shadow: var(--b4-auth-shadow);
  border: 1px solid rgba(0,0,0,.05);
}

body.b4-ui .card-header{
  background: var(--b4-auth-primary);
  color: #fff;
  border-bottom: 0;
}

body.b4-ui .card-header h1,
body.b4-ui .card-header h2,
body.b4-ui .card-header h3,
body.b4-ui .card-header h4,
body.b4-ui .card-header h5,
body.b4-ui .card-header h6{
  color: #fff;
  margin: 0;
}

/* Headings */
body.b4-ui h1, body.b4-ui h2{ color: var(--b4-auth-text); }

/* Form controls (Bootstrap) */
body.b4-ui .form-control,
body.b4-ui .form-select{
  border-radius: 10px;
  border: 1px solid var(--b4-auth-border);
  padding: 12px 12px;
}
body.b4-ui .form-control:focus,
body.b4-ui .form-select:focus{
  border-color: rgba(68, 88, 103, .75);
  box-shadow: 0 0 0 3px rgba(68, 88, 103, .14);
}

/* Bulma inputs */
body.b4-ui .input,
body.b4-ui .textarea,
body.b4-ui .select select{
  border-radius: 10px !important;
  border-color: var(--b4-auth-border) !important;
}
body.b4-ui .input:focus,
body.b4-ui .textarea:focus,
body.b4-ui .select select:focus{
  box-shadow: 0 0 0 3px rgba(68, 88, 103, .14) !important;
  border-color: rgba(68, 88, 103, .75) !important;
}

/* Buttons (Bootstrap + Bulma) - unify to Romaneio palette */
body.b4-ui .btn,
body.b4-ui .button{
  border-radius: 10px;
  font-weight: 700;
}

/* Primary action */
body.b4-ui .btn-primary,
body.b4-ui .btn-success,
body.b4-ui .button.is-primary,
body.b4-ui .button.is-success{
  background: var(--b4-auth-primary) !important;
  border-color: var(--b4-auth-primary) !important;
  color: #fff !important;
}

/* Botão primário do tema (usado em formulários específicos) */
body.b4-ui .b4-btn-primary{
  background: var(--b4-auth-primary) !important;
  border: 1px solid var(--b4-auth-primary) !important;
  color: #fff !important;
  font-weight: 700;
}
body.b4-ui .b4-btn-primary:hover{
  background: var(--b4-auth-primary-2) !important;
  border-color: var(--b4-auth-primary-2) !important;
  color: #fff !important;
}
body.b4-ui .btn-primary:hover,
body.b4-ui .btn-success:hover,
body.b4-ui .button.is-primary:hover,
body.b4-ui .button.is-success:hover{
  background: var(--b4-auth-primary-2) !important;
  border-color: var(--b4-auth-primary-2) !important;
}

/* Secondary */
body.b4-ui .btn-outline-primary,
body.b4-ui .btn-outline-success{
  border-color: var(--b4-auth-primary) !important;
  color: var(--b4-auth-primary) !important;
}
body.b4-ui .btn-outline-primary:hover,
body.b4-ui .btn-outline-success:hover{
  background: var(--b4-auth-primary) !important;
  color: #fff !important;
}

/* Tables */
body.b4-ui table.table thead th{
  background: rgba(68, 88, 103, .08);
  color: var(--b4-auth-text);
}
body.b4-ui table.table{
  border-radius: var(--b4-auth-radius);
  overflow: hidden;
}

/* Make key forms centered (without forcing all pages) */
body.b4-ui .b4-form-wrap{
  max-width: 820px;
  margin: 0 auto;
}

/* Mobile-first adjustments */
@media (max-width: 420px){
  body.b4-ui .container,
  body.b4-ui .container-fluid{ padding-left: 10px; padding-right: 10px; }
  body.b4-ui .form-control,
  body.b4-ui .form-select{ padding: 11px 12px; }
}

@media (min-width: 992px){
  body.b4-ui .b4-form-wrap{ max-width: 940px; }
}



/* ===========================
   NAVBAR / TOPBAR (B4 Romaneio)
   Works with the custom header (#header/#nav/#menu)
   and with Bootstrap .navbar when present.
   =========================== */

body.b4-ui #header{
  background: var(--b4-auth-primary);
  color:#fff;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}

body.b4-ui #logo{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  letter-spacing:.2px;
}

body.b4-ui #logo::before{
  content:"";
  width:34px;
  height:34px;
  border-radius:10px;
  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.18);
  background-image: url("/assets/img/favicon_B4.png");
  background-size: 22px 22px;
  background-position:center;
  background-repeat:no-repeat;
}

body.b4-ui #nav a{
  color:#fff;
  text-decoration:none;
}

body.b4-ui #menu a{
  padding: 10px 12px;
  border-radius: 12px;
  display:block;
  font-weight:600;
  transition: background .15s ease, transform .15s ease;
}

body.b4-ui #menu a:hover{
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

body.b4-ui #btn-mobile{
  color:#fff;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight:700;
}

body.b4-ui #btn-mobile:hover{
  background: rgba(255,255,255,.12);
}

body.b4-ui #hamburguer{
  border-top: 2px solid #fff;
  width: 20px;
}

body.b4-ui #hamburguer::after,
body.b4-ui #hamburguer::before{
  content:"";
  display:block;
  width: 20px;
  height: 2px;
  background:#fff;
  margin-top: 5px;
  transition: .3s;
  position: relative;
}

body.b4-ui #nav.active #hamburguer{
  border-top-color: transparent;
}

body.b4-ui #nav.active #hamburguer::before{
  transform: rotate(135deg);
}

body.b4-ui #nav.active #hamburguer::after{
  transform: rotate(-135deg);
  top: -7px;
}

/* Mobile menu (custom header) */
@media (max-width: 720px){
  body.b4-ui #menu{
    background: var(--b4-auth-primary);
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    box-shadow: 0 16px 30px rgba(0,0,0,.14);
  }
}

/* Bootstrap navbar harmonization (if used) */
body.b4-ui .navbar{
  background: var(--b4-auth-primary) !important;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}

body.b4-ui .navbar .nav-link{
  border-radius: 12px;
  padding: 10px 12px;
  font-weight:600;
}

body.b4-ui .navbar .nav-link:hover{
  background: rgba(255,255,255,.12);
}

/* Disabled buttons visual */
.b4-disabled,
button:disabled{
  opacity: .55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}


/* Soft hint / helper box (quase transparente) */
.b4-soft-hint{
  margin-top:14px;
  padding:14px 16px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.05);
  background: rgba(255, 255, 255, .28);
  color:#2e2e2e;
  backdrop-filter: blur(2px);
}
.b4-soft-hint b{ color:#1f2937; }

.b4-soft-footer{
  margin-top:14px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.06);
  background: rgba(245, 238, 205, .65);
}

.b4-page-wrap{ margin-top: 18px; }



/* ===== Pedidos do vendedor: tabela (desktop) + cards (mobile) ===== */
.b4-pedidos-cards{ display:none; }
.b4-pedidos-table{ display:block; }

@media (max-width: 768px){
  .b4-pedidos-cards{ display:block; }
  .b4-pedidos-table{ display:none; }
}

/* Badge simples (status) */
.b4-badge{
  display:inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(68,88,103,0.10);
  color: #445867;
  border: 1px solid rgba(68,88,103,0.20);
}

/* Card mobile */
.b4-mobile-card{
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 12px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  margin-bottom: 12px;
}

.b4-mobile-card__top{
  display:flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.b4-mobile-card__pedido{
  font-weight: 800;
  font-size: 1.05rem;
  color: #22313a;
}

.b4-mobile-card__row{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px dashed rgba(0,0,0,0.08);
}

.b4-mobile-card__row:first-of-type{
  border-top: 0;
}

.b4-mobile-card__label{
  font-size: 0.85rem;
  color: rgba(0,0,0,0.55);
  min-width: 72px;
}

.b4-mobile-card__value{
  font-size: 0.95rem;
  color: #22313a;
  text-align: right;
  word-break: break-word;
}

.b4-money{
  font-weight: 800;
}

/* Ações: botões redondos com ícones */
.b4-actions{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
}

.b4-actions--mobile{
  width:100%;
  justify-content: space-evenly;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.b4-icon-btn{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #445867;
  border: 1px solid rgba(0,0,0,0.10);
  color: #fff;
  cursor: pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: transform .06s ease, background .18s ease, box-shadow .18s ease;
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

.b4-icon-btn ion-icon{
  font-size: 18px;
}

.b4-icon-btn:hover{
  background: #3a4c59;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.14);
}

.b4-icon-btn:active{
  transform: translateY(0px);
}

.b4-icon-btn[disabled]{
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Harmoniza botão Bulma primário do projeto (quando usado) */
body.b4-ui .b4-btn-primary{
  background: #445867;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
}
body.b4-ui .b4-btn-primary:hover{
  background: #3a4c59;
}
