:root {
  --background: #f8fafc;
  --foreground: #1c2233;
  --primary: #1d4ed8;
  --muted: #64748b;
  --border: #e2e8f0;
  --sidebar: #fff;
  --sidebar-accent: #eff6ff;
  --sidebar-text: #1e293b;
  --sidebar-muted: #64748b;
  --sidebar-border: #e2e8f0;
  --accent: #fde047;
  --surface: #fff;
  --danger: #be123c;
  --danger-hover: #9f1239;
  --on-danger: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--foreground); font: 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: #94a3b8; outline: 0; box-shadow: 0 0 0 2px rgb(148 163 184 / 20%); }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 12px; background: var(--surface); z-index: 10; }
.skip-link:focus { top: 12px; }
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 256px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--sidebar-border); }
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; border-bottom: 1px solid var(--sidebar-border); color: var(--sidebar-text); }
.brand:hover, .nav-link:hover { text-decoration: none; }
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; color: var(--sidebar-muted); font-size: 12px; }
.brand-logo { display: block; width: 39px; height: 39px; max-width: 100%; object-fit: contain; flex-shrink: 0; }
.sidebar nav { padding: 24px 10px; }
.sidebar nav { overflow-y: auto; }
.nav-label:not(:first-child) { margin-top: 24px; }
.nav-label { display: block; padding: 0 12px 8px; font-size: 11px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--sidebar-muted); }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 6px; color: var(--sidebar-text); }
.nav-link.active, .nav-link:hover { background: var(--sidebar-accent); color: var(--primary); }
.icon { width: 19px; height: 19px; flex-shrink: 0; }
.sidebar-footer { margin-top: auto; padding: 20px; color: var(--sidebar-muted); font-size: 12px; border-top: 1px solid var(--sidebar-border); }
.workspace { flex: 1; min-width: 0; }
.topbar { min-height: 65px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-title { font-weight: 600; color: var(--muted); }
.user-info { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; background: var(--primary); border-radius: 50%; color: var(--surface); }
main { max-width: 1600px; margin: auto; padding: 28px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); margin-bottom: 20px; font-size: 13px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1 { font-size: 25px; letter-spacing: -.025em; line-height: 1.25; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0; }
p { color: var(--muted); margin: 4px 0 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: 7px; border: 1px solid var(--border); font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.button:hover { text-decoration: none; background: #eef1f8; }
.button-secondary { background: var(--surface); color: var(--foreground); }
.button-primary { background: var(--primary); border-color: var(--primary); color: var(--surface); }
.button-primary:hover { background: #1e40af; }
.button-danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.button-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; box-shadow: 0 1px 2px rgb(16 28 54 / 3%); }
.product-summary { padding: 28px; display: flex; align-items: center; gap: 22px; margin-bottom: 24px; }
.product-symbol { width: 86px; height: 86px; flex-shrink: 0; border-radius: 12px; background: #eff6ff; color: var(--primary); display: grid; place-items: center; }
.product-symbol svg { width: 43px; height: 43px; }
.product-identification { flex: 1; min-width: 0; }
.product-identification h2 { font-size: 24px; line-height: 1.3; margin: 5px 0 12px; overflow-wrap: anywhere; }
.eyebrow { font-size: 12px; color: var(--muted); font-weight: 600; }
.summary-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 5px; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 600; }
.badge-success { background: #ecfdf5; color: #047857; }
.price-highlight { border-left: 1px solid var(--border); padding-left: 28px; flex-shrink: 0; }
.price-highlight span, .price-highlight small { display: block; color: var(--muted); font-size: 12px; }
.price-highlight strong { display: block; color: var(--primary); font-size: 30px; letter-spacing: -.03em; margin: 4px 0; }
.price-highlight .no-price { font-size: 22px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(0, 2fr); gap: 24px; margin-bottom: 24px; }
.card-heading { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.card-heading p { font-size: 13px; }
.info-list { padding: 4px 24px 12px; margin: 0; }
.info-list > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; border-bottom: 1px solid #f1f5f9; padding: 13px 0; }
.info-list > div:last-child { border-bottom: 0; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.table-scroll { max-width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th { font-size: 12px; font-weight: 650; color: #475569; background: #f8fafc; white-space: nowrap; }
th, td { padding: 15px 20px; border-bottom: 1px solid var(--border); }
td { font-size: 13px; }
td strong { font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-cell { font-weight: 650; color: var(--primary); }
.empty-state { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty-state small { display: block; margin-top: 6px; font-size: 12px; }
.search-form { padding: 24px; border-bottom: 1px solid var(--border); }
.search-form label { display: block; margin-bottom: 8px; font-weight: 600; }
.search-controls { display: flex; gap: 10px; }
input { min-width: 0; width: 100%; max-width: 600px; border: 1px solid #cbd5e1; border-radius: 7px; padding: 10px 12px; background: var(--surface); color: var(--foreground); font: inherit; }
.product-code { display: block; color: var(--muted); margin-top: 3px; }
.detail-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; white-space: nowrap; }
.table-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.pagination { padding: 20px 24px; display: flex; align-items: center; justify-content: center; gap: 20px; border-top: 1px solid var(--border); }
@media (max-width: 1150px) {
  .detail-grid { grid-template-columns: 1fr; }
  .product-summary { flex-wrap: wrap; }
  .price-highlight { width: 100%; border-left: 0; border-top: 1px solid var(--border); padding: 18px 0 0; }
}
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .brand { padding: 16px 20px; }
  .sidebar nav { padding: 10px 16px; }
  .sidebar-footer, .nav-label { display: none; }
  .topbar { padding: 12px 20px; }
  .user-info { max-width: 65%; overflow-wrap: anywhere; }
  main { padding: 20px 16px; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 16px; }
  h1 { font-size: 23px; }
  .product-summary { padding: 20px; gap: 16px; }
  .product-symbol { width: 60px; height: 60px; }
  .product-identification h2 { font-size: 20px; }
  .card-heading, .search-form { padding: 18px; }
  .search-controls { flex-wrap: wrap; }
  .search-controls input { flex-basis: 100%; }
  .pagination { gap: 12px; padding: 16px; flex-wrap: wrap; }
}

.header-start, .header-actions { display: flex; align-items: center; gap: 16px; }
.header-actions form { margin: 0; }
.logout-button { gap: 8px; font-size: 13px; }
.logout-button:hover { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.menu-toggle { display: none; gap: 8px; }
.notice { padding: 14px 18px; border: 1px solid #bfdbfe; background: #eff6ff; margin-bottom: 20px; border-radius: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { display: flex; align-items: center; gap: 16px; padding: 22px; color: var(--muted); }
.stat-card:hover { text-decoration: none; border-color: #93c5fd; }
.stat-card strong { display: block; font-size: 28px; color: var(--foreground); margin-top: 4px; }
.stat-icon, .pending-icon { background: #eff6ff; color: var(--primary); display: grid; place-items: center; border-radius: 10px; width: 44px; height: 44px; flex-shrink: 0; }
.quick-access { margin-bottom: 24px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 22px; gap: 20px; }
.quick-grid a { padding: 18px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.quick-grid a:hover { text-decoration: none; background: #eff6ff; }
.quick-grid strong, .quick-grid span { display: block; margin-top: 10px; }
.quick-grid span { color: var(--muted); font-size: 13px; }
.heading-with-link { display: flex; gap: 16px; justify-content: space-between; align-items: center; }
.heading-with-link > a { white-space: nowrap; }
.module-pending { display: flex; flex-direction: column; align-items: center; padding: 56px 24px; text-align: center; }
.pending-icon { width: 64px; height: 64px; margin-bottom: 20px; }
.pending-icon .icon { width: 30px; height: 30px; }
.module-pending p { max-width: 520px; margin: 10px 0 24px; }
.form-field { margin-bottom: 22px; }
.form-field label { display: block; margin-bottom: 8px; font-weight: 600; }
.form-field input { max-width: none; min-height: 48px; background: #f8fafc; }
.form-field input:focus { background: #fff; }
.password-control { display: flex; position: relative; }
.password-control input { padding-right: 90px; }
.password-toggle { position: absolute; right: 4px; top: 4px; bottom: 4px; border: 0; border-radius: 5px; color: var(--primary); background: transparent; font: inherit; font-size: 12px; font-weight: 650; padding: 0 12px; cursor: pointer; }
.password-toggle:hover { background: #eff6ff; }
.login-submit { width: 100%; min-height: 48px; }
.alert-stack { position: fixed; z-index: 1000; top: 20px; right: 20px; display: grid; gap: 10px; width: min(400px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); overflow-y: auto; }
.form-alert { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px; border: 1px solid #fda4af; border-radius: 10px; background: #fff1f2; color: #9f1239; box-shadow: 0 12px 32px rgb(16 28 54 / 16%); }
.form-alert-icon { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: #ffe4e6; }
.form-alert-icon .icon { width: 17px; height: 17px; }
.form-alert-content { min-width: 0; flex: 1; padding-top: 2px; }
.form-alert-content strong { display: block; font-size: 13px; }
.form-alert-content p { color: #9f1239; font-size: 13px; margin: 2px 0 0; }
.form-alert-close { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; margin: -8px -8px -8px 0; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #9f1239; cursor: pointer; }
.form-alert-close:hover { background: #ffe4e6; }
.form-alert-close .icon { width: 18px; height: 18px; }
.form-alert[data-level~="success"] { border-color: #86efac; background: #f0fdf4; color: #166534; }
.form-alert[data-level~="success"] .form-alert-icon, .form-alert[data-level~="success"] .form-alert-close:hover { background: #dcfce7; }
.form-alert[data-level~="success"] .form-alert-content p, .form-alert[data-level~="success"] .form-alert-close { color: #166534; }
.form-alert[data-level~="warning"] { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.form-alert[data-level~="warning"] .form-alert-icon, .form-alert[data-level~="warning"] .form-alert-close:hover { background: #fef3c7; }
.form-alert[data-level~="warning"] .form-alert-content p, .form-alert[data-level~="warning"] .form-alert-close { color: #92400e; }
.form-alert[data-level~="info"] { border-color: #93c5fd; background: #eff6ff; color: #1e40af; }
.form-alert[data-level~="info"] .form-alert-icon, .form-alert[data-level~="info"] .form-alert-close:hover { background: #dbeafe; }
.form-alert[data-level~="info"] .form-alert-content p, .form-alert[data-level~="info"] .form-alert-close { color: #1e40af; }
@media (max-width: 480px) {
  .alert-stack { top: 16px; right: 16px; left: 16px; width: auto; max-height: calc(100dvh - 32px); }
}
@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .quick-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .app-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
  .workspace { display: contents; }
  .topbar { grid-row: 1; padding: 12px 16px; gap: 8px; }
  .sidebar { display: none; grid-row: 2; }
  .sidebar.is-open { display: flex; }
  .sidebar .brand { display: none; }
  .sidebar .nav-label { display: block; }
  .sidebar nav { max-height: 55vh; padding: 16px; }
  main#conteudo { grid-row: 3; width: 100%; }
  .menu-toggle { display: inline-flex; }
  .header-start, .header-actions { gap: 8px; }
  .topbar-title { font-size: 13px; }
  .header-actions .user-info > span:last-child { display: none; }
  .header-actions .user-info { max-width: none; }
  .header-actions .avatar { width: 28px; height: 28px; }
  .logout-button { padding: 8px 10px; }
  .logout-button .icon { display: none; }
  .stats-grid { gap: 12px; }
  .stat-card { padding: 16px; gap: 10px; flex-wrap: wrap; font-size: 12px; }
  .heading-with-link { flex-wrap: wrap; }
}
