/* Navegação e módulos completos, mantendo os componentes comerciais existentes. */
[hidden] { display: none !important; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 9px 12px; border-radius: 7px; color: #fff; background: #174fae; font-size: 12px; font-weight: 800; text-decoration: none; transform: translateY(-160%); transition: transform .15s ease; }
.skip-link:focus { transform: translateY(0); outline: 3px solid #7eaff9; outline-offset: 2px; }
.app-shell { grid-template-columns: 254px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 25px 14px 16px; background: linear-gradient(180deg,#0b1b30,#081629); border-right: 1px solid #173453; }
.main-nav { display: block; margin-top: 25px; overflow-y: auto; padding-right: 5px; scrollbar-width: thin; scrollbar-color: #55718f #0b1b30; }
.nav-label, .nav-group summary { display: block; padding: 14px 12px 8px; color: #86a5c8; font-size: 9px; font-weight: 800; letter-spacing: .1em; cursor: pointer; }
.nav-group summary { list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: '⌄'; float: right; }
.nav-group:not([open]) summary::after { content: '›'; }
.nav-item { color: #c6d6e8; font-size: 12px; margin: 3px 0; padding: 10px 12px; }
.nav-item.active { background: linear-gradient(90deg,#2563d8,#1d5ac8); box-shadow: 0 7px 18px #1453b447; }
.sidebar-footer { flex-shrink: 0; margin-top: 14px; padding-top: 8px; }
.sidebar-footer .nav-item, .sidebar-footer .sidebar-link { font-size: 11px; padding: 8px 12px; }
.content { padding: 26px clamp(18px,3vw,44px) 45px; }
.topbar { align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: clamp(24px,2.5vw,32px); }
.favorites-area { display: grid; gap: 12px; margin: -4px 0 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.favorites-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.favorites-heading .eyebrow { margin-bottom: 4px; }
.favorites-heading h2 { margin: 0; color: #253551; font-size: 14px; letter-spacing: -.015em; }
.favorites-hint, .favorites-empty { margin: 0; color: var(--text-soft); font-size: 11px; }
.favorites-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 30px; }
.favorite-item { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 8px 10px; border: 1px solid #d9e5f5; border-radius: 8px; color: #365274; background: #f7faff; font-size: 11px; font-weight: 800; text-align: left; }
.favorite-item span { width: 14px; color: #3274dd; font-size: 14px; text-align: center; }
.favorite-item:hover, .favorite-item.active { border-color: #3274dd; color: #fff; background: var(--blue); }
.favorite-item:hover span, .favorite-item.active span { color: #d9eaff; }
.favorites-context-menu { position: fixed; z-index: 50; min-width: 190px; padding: 5px; border: 1px solid #cddced; border-radius: 9px; background: #fff; box-shadow: 0 12px 30px #132d4a2b; }
.favorites-context-menu button { width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; color: #253551; background: transparent; font-size: 12px; font-weight: 700; text-align: left; }
.favorites-context-menu button:hover, .favorites-context-menu button:focus-visible { color: #174fae; background: #eaf2ff; outline: none; }
.menu-button { display: none; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 29; background: #07142680; border: 0; }
.module-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 20px; }
.module-tabs [aria-pressed="true"] { color: #fff; background: var(--blue); }
.module-note { background: #edf4fd; border-left: 3px solid #91b8f0; color: #526681; padding: 12px 15px; font-size: 12px; line-height: 1.6; margin: 16px 0; }
.period-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 18px; }
.period-controls .field { max-width: 180px; }
.period-controls .button { min-height: 38px; }
.table-toolbar { margin-top: 18px; flex-wrap: wrap; }
.table-toolbar .field { min-width: 130px; }
.table-toolbar input[type="search"] { flex: 1 1 220px; }
.flow-board { display: grid; grid-auto-flow: column; grid-auto-columns: 260px; gap: 14px; overflow-x: auto; padding: 4px 0 20px; align-items: start; }
.flow-column { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #edf2f9; min-height: 280px; }
.flow-column h3 { font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.flow-card { margin-top: 14px; border: 1px solid #e0e7f2; border-radius: 10px; padding: 15px; background: #fff; box-shadow: 0 4px 12px #1b355508; }
.flow-card > small { color: var(--text-soft); font-size: 10px; }
.flow-card[draggable] { cursor: grab; }
.flow-card h3 { margin: 12px 0; }
.flow-card .actions { justify-content: flex-start; margin-top: 12px; }
.flow-empty { color: var(--text-soft); font-size: 12px; margin-top: 25px; text-align: center; }
.pos-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,1fr); gap: 18px; align-items: start; }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 12px; max-height: 60vh; overflow-y: auto; padding: 2px; }
.pos-product { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: #fff; text-align: left; color: #253551; min-height: 145px; }
.pos-product:hover { border-color: var(--blue); background: #f5f9ff; }
.pos-product small { color: var(--text-soft); font-size: 11px; }
.pos-product b { margin-top: auto; color: var(--blue); }
.cart-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 17px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.cart-row small { display: block; margin-top: 5px; color: var(--text-soft); }
.quantity-controls { display: flex; align-items: center; gap: 10px; }
.purchase-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 9px; align-items: end; margin: 15px 0; }
.notification-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 14px; }
.notification-read { opacity: .68; }
.notification-list p { font-size: 12px; }
.message-preview { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 18px; color: #526681; line-height: 1.7; }
.scanner-video { width: 100%; max-height: 400px; border-radius: 10px; background: #091a2d; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #7eaff9; outline-offset: 3px; }
td { overflow-wrap: anywhere; }
.cards { margin-top: 18px; }
@media (max-width: 1100px) { .topbar-actions { gap: 8px; } .user-chip > span:last-child { display: none; } .company-picker { min-width: 160px; } .pos-layout { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; width: 254px; height: 100dvh; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px #07142655; }
  .menu-button { display: inline-flex; }
  .main-nav { display: block; overflow-y: auto; }
  .sidebar-footer { display: grid; }
  .topbar { display: flex; flex-direction: row; flex-wrap: wrap; gap: 14px; }
  .topbar > div:first-of-type { flex: 1; }
  .topbar-actions { display: flex; flex-direction: row; width: 100%; align-items: center; }
  .company-picker { flex: 1; min-width: 0; width: auto; }
  .user-chip { align-self: center; }
  .content { padding: 20px 14px 40px; }
  .nav-item { min-width: 0; }
  .favorites-area { margin-bottom: 20px; padding: 14px; }
  .pos-products { max-height: 42vh; }
}
@media (max-width: 540px) { .cards { grid-template-columns: 1fr 1fr; gap: 10px; } .metric-card { padding: 14px; } .metric-card strong { font-size: 20px; } .favorites-heading { align-items: flex-start; flex-direction: column; gap: 5px; } .favorite-item { max-width: 100%; } .purchase-row { grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); padding-bottom: 14px; } .purchase-row .field:first-child { grid-column: 1/-1; } .pos-products { grid-template-columns: 1fr 1fr; } .pos-product { padding: 12px; } .period-controls .field { max-width: calc(50% - 10px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media print {
  @page { margin: 12mm; }
  *, *::before, *::after { color-adjust: exact; print-color-adjust: exact; }
  body { min-width: 0; color: #172033; background: #fff !important; }
  .sidebar, .topbar, #favorites-area, #global-message, #toast, #favorites-context-menu,
  .print-page-button, .heading-actions .button:not(.print-page-button), .actions,
  .button, .modal-backdrop, .close-button, .modal-footer { display: none !important; }
  .app-shell { display: block !important; min-height: 0; }
  .content { padding: 0 !important; }
  #page-content { width: 100%; }
  .page-heading { display: block; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #cbd5e1; }
  .page-heading p { color: #34425c; font-size: 11pt; }
  .cards { grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
  .metric-card, .panel, .table-shell { border-color: #cbd5e1; box-shadow: none; }
  .table-shell { overflow: visible; }
  table { min-width: 0; font-size: 9pt; }
  th { background: #f2f5f9 !important; }
  th, td { padding: 7px 8px; }
  .modal:not([hidden]) { position: static; display: block; padding: 0; }
  .modal:not([hidden]) .modal-card { width: 100%; max-height: none; overflow: visible; padding: 0; box-shadow: none; }
  body.print-modal .app-shell { display: none !important; }
  body.print-modal .modal { position: static; }
}
