/* Beghim V6.4 — navegação por módulos inspirada em ERP */
:root{
  --v64-rail:#25070d;
  --v64-rail-2:#3b0912;
  --v64-top:#300811;
  --v64-card-shadow:0 10px 28px rgba(20,28,38,.08);
}

/* Shell */
.app-shell{grid-template-columns:72px minmax(0,1fr);background:#f5f7f9}
.sidebar.v64-rail{width:72px;padding:10px 8px;background:linear-gradient(180deg,var(--v64-rail-2),var(--v64-rail));align-items:center;overflow:visible}
.v64-legacy-nav{display:none!important}
.v64-rail-logo{width:48px;height:48px;border:0;border-radius:14px;background:#fff;color:var(--wine);font-weight:950;font-size:21px;display:grid;place-items:center;margin:1px 0 18px;box-shadow:0 7px 18px rgba(0,0,0,.18)}
.v64-rail-nav{display:flex;flex-direction:column;gap:8px;width:100%;align-items:center}
.v64-rail-btn,.v64-rail-help{position:relative;width:48px;height:48px;border:0;border-radius:13px;background:transparent;color:#d9bbc2;display:grid;place-items:center;transition:.16s}
.v64-rail-btn:hover,.v64-rail-btn.active,.v64-rail-help:hover{background:rgba(255,255,255,.12);color:#fff;transform:translateY(-1px)}
.v64-rail-btn svg,.v64-rail-help svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.v64-rail-btn>span{position:absolute;left:60px;top:50%;transform:translateY(-50%) translateX(-5px);background:#1c222b;color:#fff;padding:7px 9px;border-radius:8px;font-size:11px;font-weight:800;white-space:nowrap;opacity:0;pointer-events:none;transition:.13s;box-shadow:0 8px 20px rgba(0,0,0,.2)}
.v64-rail-btn:hover>span{opacity:1;transform:translateY(-50%) translateX(0)}
.v64-rail-footer{margin-top:auto;width:100%;display:flex;flex-direction:column;align-items:center;gap:10px}
.v64-rail-footer .mode-pill{font-size:0;width:11px;height:11px;border-radius:50%;padding:0;background:#38b56a;border:2px solid rgba(255,255,255,.75)}
.v64-rail-footer .mode-pill.mode-demo{width:11px;height:11px;padding:0;border-radius:50%!important;font-size:0!important;background:#e2a134!important;border:2px solid #fff!important}

.main{min-width:0;background:#f5f7f9}
.v64-topbar{height:62px;background:linear-gradient(90deg,var(--v64-top),#4b0b17);border-bottom:0;color:#fff;padding:0 20px;box-shadow:0 2px 12px rgba(24,8,12,.18)}
.v64-product-name{display:flex;align-items:center;gap:10px;min-width:250px;padding-right:18px;border-right:1px solid rgba(255,255,255,.15)}
.v64-product-name strong{font-size:14px;letter-spacing:.1em}
.v64-product-name span{font-size:10px;color:#d8c2c7;white-space:nowrap}
.v64-topbar .topbar-copy h1{color:#fff;font-size:15px;font-weight:800}
.v64-topbar .topbar-copy p{color:#cdb6bc;font-size:10px;margin-top:2px}
.v64-topbar .user-box{border-left:1px solid rgba(255,255,255,.13);padding-left:10px;padding-right:5px}
.v64-topbar .user-box strong{color:#fff}
.v64-topbar .user-box small{color:#cdb6bc}
.v64-topbar .avatar{background:#fff;color:var(--wine);box-shadow:0 0 0 2px rgba(255,255,255,.16)}
.v64-top-icon{width:36px;height:36px;border:0;border-radius:10px;background:transparent;color:#f1e7e9;display:grid;place-items:center;transition:.14s}
.v64-top-icon:hover{background:rgba(255,255,255,.12);color:#fff}
.v64-top-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.v64-top-icon rect{fill:none}
.v64-new-quote{background:#fff!important;color:var(--wine)!important;border:0!important;padding:9px 13px!important;box-shadow:0 4px 12px rgba(0,0,0,.13)}
.v64-new-quote:hover{background:#f7ecef!important}
.v64-new-quote span{font-size:16px;line-height:1}
.v64-topbar .icon-btn.mobile-only{background:rgba(255,255,255,.12);color:#fff}

/* Dashboard / home de módulos */
#view-dashboard{padding-top:26px;max-width:1560px;margin:0 auto}
.erp-home-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:0 0 24px;padding:0 2px}
.erp-greeting{display:block;color:var(--wine);font-size:15px;font-weight:800;margin-bottom:4px}
.erp-home-head h2{font-size:25px;margin:0;color:#202936;letter-spacing:-.02em}
.erp-home-head p{margin:7px 0 0;color:var(--muted);font-size:12px}
.v64-home-cta{background:var(--wine);color:#fff;box-shadow:0 8px 20px rgba(111,16,33,.2)}

.erp-modules-wrap{display:grid;gap:20px;margin-bottom:28px}
.erp-module-section{background:#fff;border:1px solid #e1e6eb;border-radius:17px;padding:18px 19px;box-shadow:0 4px 16px rgba(22,31,42,.035)}
.erp-section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}
.erp-section-head h3{margin:0;font-size:13px;color:#2a3542}
.erp-section-head p{margin:3px 0 0;font-size:10px;color:#8a95a3}
.erp-module-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.erp-module-card{--mod:#6f1021;position:relative;min-height:118px;border:0;border-radius:14px;padding:16px;background:var(--mod);color:#fff;text-align:left;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;overflow:hidden;box-shadow:0 8px 22px color-mix(in srgb,var(--mod) 22%,transparent);transition:transform .16s,box-shadow .16s,filter .16s}
.erp-module-card:before{content:"";position:absolute;width:92px;height:92px;border-radius:50%;right:-32px;top:-35px;background:rgba(255,255,255,.10)}
.erp-module-card:hover{transform:translateY(-3px);filter:saturate(1.04);box-shadow:0 14px 28px color-mix(in srgb,var(--mod) 28%,transparent)}
.erp-module-icon{width:33px;height:33px;display:grid;place-items:center;position:relative;z-index:1}
.erp-module-icon svg{width:27px;height:27px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.erp-module-copy{position:relative;z-index:1;display:block;padding-top:13px}
.erp-module-copy strong{display:block;font-size:14px;color:#fff}
.erp-module-copy small{display:block;margin-top:4px;font-size:10px;line-height:1.3;color:rgba(255,255,255,.78);font-weight:600}
.erp-module-arrow{position:absolute;right:14px;bottom:12px;font-size:22px;color:rgba(255,255,255,.55);transition:transform .16s}
.erp-module-card:hover .erp-module-arrow{transform:translateX(3px);color:#fff}
.mod-wine{--mod:#7a1026}.mod-teal{--mod:#087f80}.mod-blue{--mod:#2766ad}.mod-amber{--mod:#b9770e}.mod-indigo{--mod:#4c5eb2}.mod-slate{--mod:#495969}.mod-copper{--mod:#a85c27}.mod-green{--mod:#347d4c}.mod-cyan{--mod:#1588a5}.mod-gray{--mod:#596574}.mod-red{--mod:#a63e42}.mod-purple{--mod:#71518e}
.erp-dashboard-divider{display:flex;align-items:center;gap:12px;margin:4px 0 15px;color:#7a8593;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.1em}
.erp-dashboard-divider:after{content:"";height:1px;background:#dce2e8;flex:1}
#view-dashboard .kpi-card{border-radius:14px;box-shadow:none}
#view-dashboard .panel{border-radius:15px;box-shadow:none}

/* Launcher */
.v64-launcher-backdrop{position:fixed;inset:0;background:rgba(17,23,31,.46);z-index:120;opacity:0;pointer-events:none;transition:opacity .18s;display:flex;justify-content:flex-start;padding-left:72px}
.v64-launcher-backdrop.open{opacity:1;pointer-events:auto}
.v64-launcher-panel{width:min(760px,calc(100vw - 92px));height:100%;background:#fff;box-shadow:20px 0 50px rgba(0,0,0,.18);padding:24px;overflow:auto;transform:translateX(-18px);transition:transform .18s}
.v64-launcher-backdrop.open .v64-launcher-panel{transform:translateX(0)}
.v64-launcher-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.v64-launcher-head h2{margin:5px 0 3px;font-size:21px}
.v64-launcher-head p{margin:0;color:var(--muted);font-size:11px}
.v64-launcher-close{width:36px;height:36px;border:0;border-radius:10px;background:#f2f4f7;color:#4f5b68;font-size:22px}
.v64-launcher-search{height:44px;border:1px solid var(--line);border-radius:12px;display:flex;align-items:center;gap:9px;padding:0 12px;margin-bottom:20px;background:#fafbfc}
.v64-launcher-search:focus-within{border-color:#b45b6d;box-shadow:0 0 0 3px rgba(111,16,33,.07);background:#fff}
.v64-launcher-search svg{width:18px;height:18px;fill:none;stroke:#667384;stroke-width:2;stroke-linecap:round}
.v64-launcher-search input{border:0;background:transparent;padding:0;box-shadow:none!important}
.v64-launcher-groups{display:grid;gap:22px}
.v64-launcher-groups>section>h3{font-size:11px;text-transform:uppercase;letter-spacing:.09em;color:#6d7886;margin:0 0 9px}
.v64-launcher-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.v64-launcher-panel .erp-module-card{min-height:92px;padding:12px;border-radius:12px}
.v64-launcher-panel .erp-module-icon{width:28px;height:28px}
.v64-launcher-panel .erp-module-icon svg{width:23px;height:23px}
.v64-launcher-panel .erp-module-copy{padding-top:8px}
.v64-launcher-panel .erp-module-copy strong{font-size:12px}
.v64-launcher-panel .erp-module-copy small{display:none}
.v64-launcher-panel .erp-module-arrow{font-size:18px;right:11px;bottom:8px}
.v64-launcher-empty{padding:36px 12px;text-align:center;color:var(--muted);font-size:12px}
body.v64-launcher-open{overflow:hidden}

/* Compactação visual das telas internas, como módulos de ERP */
.view:not(#view-dashboard){padding-top:20px}
.view:not(#view-dashboard)>.panel:first-child,.view:not(#view-dashboard)>.quote-toolbar:first-child{margin-top:0}

@media(max-width:1250px){
  .erp-module-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .v64-product-name{min-width:190px}.v64-product-name span{display:none}
}
@media(max-width:980px){
  .erp-module-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .v64-topbar .topbar-copy p{display:none}
  .v64-product-name{min-width:auto;border-right:0;padding-right:4px}.v64-product-name span{display:none}
  .v64-launcher-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:800px){
  .app-shell{display:block}
  .sidebar.v64-rail{position:fixed;left:-88px;top:0;width:72px;height:100vh;padding:10px 8px;transition:left .2s}
  .sidebar.v64-rail.open{left:0}
  .v64-rail-btn>span{display:none}
  .v64-topbar{min-height:62px;height:62px;padding:0 10px;gap:8px}
  .v64-product-name{display:none}
  .v64-topbar .topbar-copy{min-width:0}
  .v64-topbar .topbar-copy h1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .v64-topbar .user-box{display:none}
  .v64-top-icon#v64SearchBtn{display:none}
  .v64-new-quote{font-size:0;width:38px;height:38px;padding:0!important;display:grid;place-items:center}
  .v64-new-quote span{font-size:20px}
  #view-dashboard{padding-top:20px}
  .erp-home-head{align-items:flex-start;flex-direction:column}
  .erp-home-head h2{font-size:22px}
  .erp-module-section{padding:15px}
  .erp-module-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .erp-module-card{min-height:108px;padding:13px}
  .v64-launcher-backdrop{padding-left:0}
  .v64-launcher-panel{width:min(92vw,720px);max-width:92vw}
}
@media(max-width:520px){
  .erp-module-section{padding:13px;border-radius:14px}
  .erp-section-head p{display:none}
  .erp-module-grid{grid-template-columns:1fr 1fr}
  .erp-module-card{min-height:102px}
  .erp-module-copy strong{font-size:12px}
  .erp-module-copy small{font-size:9px}
  .v64-launcher-panel{width:100vw;max-width:100vw;padding:18px}
  .v64-launcher-grid{grid-template-columns:1fr 1fr}
  .v64-launcher-panel .erp-module-card{min-height:84px}
}
@media print{
  .v64-launcher-backdrop{display:none!important}
}
