/* BRAVUR v0.1 — camada global de interface e navegação */
:root{
  --bravur-focus:0 0 0 4px rgba(242,201,76,.28);
  --bravur-topbar-h:66px;
  --bravur-bottom-nav-h:70px;
}
body.ui-v01{min-height:100vh}
body.ui-v01 a:focus-visible,
body.ui-v01 button:focus-visible,
body.ui-v01 input:focus-visible,
body.ui-v01 select:focus-visible,
body.ui-v01 textarea:focus-visible{outline:none;box-shadow:var(--bravur-focus)}
body.ui-v01 button:disabled,
body.ui-v01 .btn.is-loading{opacity:.68;cursor:wait;transform:none!important;pointer-events:none}
body.ui-v01 .main-topbar{min-height:var(--bravur-topbar-h)}
body.ui-v01 .main-topbar-inner{min-height:var(--bravur-topbar-h)}
body.ui-v01 .main-topbar-title strong{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:380px}
body.ui-v01 .main-topbar-title small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:520px}
body.ui-v01 .sidebar-toggle{min-width:44px;padding:9px 12px}
body.ui-v01 .smart-back{width:auto;background:#fff;color:#222;border:1px solid var(--line);padding:9px 11px;border-radius:12px;font-weight:900;box-shadow:0 4px 12px rgba(15,23,42,.04)}
body.ui-v01 .smart-back:hover{background:#f4f5f7;color:#111}
body.ui-v01 .smart-back[hidden]{display:none!important}
body.ui-v01 .top-quick-actions{display:flex;gap:7px;align-items:center}
body.ui-v01 .top-quick-actions a{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border:1px solid var(--line);background:#fff;border-radius:11px;min-height:38px;padding:8px 11px;font-size:12px;font-weight:900;color:#262626;white-space:nowrap}
body.ui-v01 .top-quick-actions a:hover{background:#f8f8f8}
body.ui-v01 .top-quick-actions a.primary{background:var(--brand);border-color:var(--brand);color:#111}
body.ui-v01 .top-quick-actions a.whatsapp{color:#166534;border-color:#bbdfc7;background:#f1faf4}
body.ui-v01 .container{overflow:visible}
body.ui-v01 .page-title{padding-bottom:14px;border-bottom:1px solid rgba(226,229,234,.9)}
body.ui-v01 .page-title h1,
body.ui-v01 .page-title h2{line-height:1.08}
body.ui-v01 .card,
body.ui-v01 .box,
body.ui-v01 .panel{transition:border-color .15s ease,box-shadow .15s ease}
body.ui-v01 .card:hover{border-color:#d7dce3;box-shadow:0 8px 22px rgba(15,23,42,.06)}
body.ui-v01 .table-wrap{scrollbar-width:thin;scrollbar-color:#b6bec9 transparent}
body.ui-v01 tbody tr:hover{background:#fffdf5}
body.ui-v01 input[readonly]{background:#f6f7f8;color:#555}
body.ui-v01 .actions form,
body.ui-v01 .acoes form{margin:0}
body.ui-v01 .ui-shortcut{font-size:10px;color:#8b8b8b;margin-left:3px}

.ui-mobile-backdrop{display:none;position:fixed;inset:0;background:rgba(15,23,42,.48);z-index:44;backdrop-filter:blur(2px)}
.mobile-bottom-nav{display:none}
.ui-toast-stack{position:fixed;top:82px;right:18px;z-index:2000;width:min(390px,calc(100vw - 28px));display:flex;flex-direction:column;gap:9px;pointer-events:none}
.ui-toast{pointer-events:auto;background:#fff;border:1px solid var(--line);border-left:5px solid #475569;border-radius:14px;padding:12px 13px;box-shadow:0 16px 40px rgba(15,23,42,.18);display:grid;grid-template-columns:1fr auto;gap:10px;align-items:start;animation:bravurToastIn .18s ease}
.ui-toast.success{border-left-color:#15803d}.ui-toast.error{border-left-color:#b91c1c}.ui-toast.warning{border-left-color:#d97706}
.ui-toast strong{display:block;font-size:13px;margin-bottom:3px}.ui-toast span{font-size:12px;color:#5f6772;line-height:1.4}.ui-toast button{background:transparent!important;color:#555!important;border:0!important;width:28px!important;height:28px!important;padding:0!important;border-radius:8px!important;font-size:18px!important}
@keyframes bravurToastIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}

.ui-session-banner{position:fixed;inset:0;z-index:99999;background:rgba(15,23,42,.72);display:flex;align-items:center;justify-content:center;padding:20px}
.ui-session-card{width:min(440px,100%);background:#fff;border-radius:20px;padding:24px;box-shadow:0 24px 70px rgba(0,0,0,.3);text-align:center}
.ui-session-card h2{margin:0 0 8px}.ui-session-card p{color:#667085;line-height:1.5}.ui-session-card a{display:inline-flex;margin-top:10px;background:#111;color:#fff;border-radius:12px;padding:11px 16px;text-decoration:none;font-weight:900}

@media(max-width:1180px){
  body.ui-v01 .top-quick-actions a span.label{display:none}
  body.ui-v01 .main-topbar-title small{max-width:310px}
}

@media(max-width:900px){
  body.ui-v01{padding-bottom:var(--bravur-bottom-nav-h)}
  body.ui-v01 .sidebar{position:fixed;left:0;top:0;bottom:0;width:min(86vw,330px);height:100dvh;max-height:none;z-index:50;transform:translateX(-105%);box-shadow:18px 0 50px rgba(15,23,42,.28);overflow:hidden}
  body.ui-v01.mobile-menu-open .sidebar{transform:translateX(0)}
  body.ui-v01.mobile-menu-open .ui-mobile-backdrop{display:block}
  body.ui-v01 .sidebar-scroll{display:block;max-height:none;height:calc(100dvh - 142px);padding:10px;overflow-y:auto}
  body.ui-v01 .side-section{margin-bottom:15px}
  body.ui-v01 .side-section-title{display:block;margin:12px 8px 7px}
  body.ui-v01 .side-link{font-size:13px;padding:11px;margin-bottom:5px}
  body.ui-v01 .sidebar-footer{display:block}
  body.ui-v01 .main-area{margin-left:0}
  body.ui-v01.sidebar-collapsed .sidebar{display:flex;transform:translateX(-105%)}
  body.ui-v01.mobile-menu-open.sidebar-collapsed .sidebar{display:flex;transform:translateX(0)}
  body.ui-v01 .main-topbar{position:sticky;top:0}
  body.ui-v01 .main-topbar-inner{padding:9px 11px;gap:8px}
  body.ui-v01 .main-topbar-title-wrap{gap:7px;min-width:0}
  body.ui-v01 .sidebar-toggle{width:42px;min-width:42px;height:42px;padding:0;font-size:0}
  body.ui-v01 .sidebar-toggle::before{content:'☰';font-size:18px}
  body.ui-v01 .smart-back{width:42px;height:42px;padding:0;font-size:0}
  body.ui-v01 .smart-back::before{content:'←';font-size:20px}
  body.ui-v01 .main-topbar-title strong{font-size:14px;max-width:calc(100vw - 130px)}
  body.ui-v01 .main-topbar-title small{display:none}
  body.ui-v01 .top-actions{display:none}
  body.ui-v01 .app-shell{padding:9px}
  body.ui-v01 .container{padding:12px;border-radius:16px;min-height:calc(100vh - 92px)}
  body.ui-v01 .page-title{margin-bottom:13px;padding-bottom:12px}
  body.ui-v01 .page-title h1,
  body.ui-v01 .page-title h2{font-size:22px}
  body.ui-v01 .page-title .actions,
  body.ui-v01 .page-title .acoes{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  body.ui-v01 .page-title .actions>*:only-child,
  body.ui-v01 .page-title .acoes>*:only-child{grid-column:1/-1}
  body.ui-v01 .page-title .actions a,
  body.ui-v01 .page-title .acoes a,
  body.ui-v01 .page-title .actions button,
  body.ui-v01 .page-title .acoes button{width:100%}
  body.ui-v01 .table-wrap{margin-left:-3px;margin-right:-3px}
  .mobile-bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:42;height:var(--bravur-bottom-nav-h);display:grid;grid-template-columns:repeat(5,1fr);background:rgba(255,255,255,.96);backdrop-filter:blur(12px);border-top:1px solid #dfe3e8;padding:6px max(6px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));box-shadow:0 -8px 24px rgba(15,23,42,.08)}
  .mobile-bottom-nav a,.mobile-bottom-nav button{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:100%!important;height:56px!important;padding:4px 2px!important;border-radius:11px!important;background:transparent!important;border:0!important;color:#59616d!important;text-decoration:none;font-size:10px!important;font-weight:900!important;white-space:nowrap!important;transform:none!important}
  .mobile-bottom-nav .nav-icon{font-size:19px;line-height:1}.mobile-bottom-nav a.active{background:var(--brand-soft)!important;color:#5c4600!important}.mobile-bottom-nav a.new-order{background:var(--brand)!important;color:#111!important}
  .ui-toast-stack{top:70px;right:10px;width:calc(100vw - 20px)}
}
