html, body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.35;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(37, 99, 235, 0.28), rgba(37, 99, 235, 0) 60%),
    radial-gradient(900px 600px at 90% 30%, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0) 55%),
    linear-gradient(180deg, #0b1220, #0f172a);
  pointer-events: none;
  z-index: -1;
}
body.company-bg {
  background: #6b7280;
}
body.company-bg::before {
  display: block;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0) 60%),
    radial-gradient(900px 600px at 90% 30%, rgba(220, 38, 38, 0.12), rgba(220, 38, 38, 0) 55%),
    linear-gradient(180deg, #111827, #6b7280);
  opacity: 1;
}
*[hidden] {
  display: none !important;
}
*, *::before, *::after {
  box-sizing: border-box;
}
:root {
  --blue: #2563eb;
  --blue-700: #1d4ed8;
  --accent: #2563eb;
  --accent-700: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.22);
  --green: rgba(22, 163, 74, 1);
  --green-light: rgba(34, 197, 94, 0.10);
  --red: rgba(220, 38, 38, 1);
  --red-light: rgba(220, 38, 38, 0.10);
  --slate-950: #020617;
  --slate-900: #0b1220;
  --slate-800: #0f172a;
  --ring: rgba(37, 99, 235, 0.22);
  --shadow-lg: 0 28px 70px rgba(2, 6, 23, 0.28), 0 12px 26px rgba(2, 6, 23, 0.18);
  --shadow-md: 0 18px 40px rgba(2, 6, 23, 0.18), 0 6px 14px rgba(2, 6, 23, 0.10);
  --radius-lg: 14px;
  --radius-md: 10px;
}
body.dashboard-mode[data-brand="group"] {
  --accent: #ef4444;
  --accent-700: #dc2626;
  --accent-soft: rgba(220, 38, 38, 0.22);
}
.container {
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-screen {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.login-card {
  width: 420px;
  max-width: 92vw;
  background: #ffffff;
  color: #0b1220;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: var(--shadow-md);
  padding: 40px 32px 36px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.login-card {
  position: relative;
}
.login-logo {
  display: block;
  margin: 0 auto 28px auto;
  height: 240px;
  max-height: 240px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.login-form {
  display: grid;
  gap: 16px;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #d6dbe3;
  background: #f8fafc;
  color: #0b1220;
  outline: none;
  display: block;
  box-sizing: border-box;
  line-height: 1.2;
  font-size: 15px;
  font-family: inherit;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="password"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--ring);
  background: #ffffff;
}
select.input,
textarea.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #d6dbe3;
  background: #f8fafc;
  color: #0b1220;
  outline: none;
  display: block;
  box-sizing: border-box;
  line-height: 1.2;
  font-size: 15px;
  font-family: inherit;
}
select.input {
  cursor: pointer;
}
select.input:focus,
textarea.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--ring);
  background: #ffffff;
}
.input-error {
  border-color: rgba(239, 68, 68, 0.85) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16) !important;
  background: #ffffff !important;
}
input::placeholder {
  color: #94a3b8;
}
.btn-primary {
  background: linear-gradient(180deg, var(--blue), var(--blue-700));
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.22);
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.btn-primary.btn-primary-sm {
  width: auto;
  padding: 10px 14px;
  font-size: 12px;
  border-radius: 10px;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}
.btn-primary:hover {
  filter: brightness(0.96);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.26);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.75), 0 0 0 7px rgba(37, 99, 235, 0.28);
}
.auth-result {
  background: #0b1220;
  color: #2563eb;
  border: 1px solid #1f2a44;
  padding: 10px;
  border-radius: 8px;
  margin-top: 12px;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2000;
  min-width: 280px;
  max-width: min(460px, calc(100vw - 36px));
  border-radius: 14px;
  box-shadow: 0 22px 44px rgba(2, 6, 23, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.88);
  color: #2563eb;
  backdrop-filter: blur(10px);
  overflow: hidden;
  transform: translateY(10px);
  opacity: 0;
  animation: toast-in .18s ease-out forwards;
}
.toast-success {
  border-color: rgba(34, 197, 94, 0.32);
}
.toast-error {
  border-color: rgba(239, 68, 68, 0.32);
}
.toast-inner {
  display: grid;
  grid-template-columns: 36px 1fr 30px;
  gap: 10px;
  padding: 12px 12px 10px;
  align-items: start;
}
.toast-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.toast-success .toast-ico {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.22);
}
.toast-error .toast-ico {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.22);
}
.toast-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
}
.toast-content {
  display: grid;
  gap: 2px;
}
.toast-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: rgba(37, 99, 235, 0.92);
}
.toast-msg {
  font-size: 13px;
  font-weight: 700;
  color: rgba(37, 99, 235, 0.84);
  line-height: 1.25;
}
.toast-close {
  border: 0;
  background: transparent;
  color: rgba(37, 99, 235, 0.7);
  font-size: 20px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.toast-close:hover {
  background: rgba(148, 163, 184, 0.12);
  color: rgba(37, 99, 235, 0.9);
}
.toast-close:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(148, 163, 184, 0.35);
}
.toast-bar {
  height: 3px;
  background: rgba(148, 163, 184, 0.18);
  position: relative;
}
.toast-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.95), rgba(59, 130, 246, 0.95));
  transform-origin: left;
  animation: toast-bar 2.6s linear forwards;
}
.toast-error .toast-bar::after {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(249, 115, 22, 0.95));
}
@keyframes toast-in {
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toast-bar {
  to { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; transform: none; opacity: 1; }
  .toast-bar::after { animation: none; }
}
.company-screen {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.company-card {
  width: 520px;
  max-width: 94vw;
  background: #ffffff;
  color: #0b1220;
  border-radius: var(--radius-md);
  border: 1px solid #e5e7eb;
  box-shadow: var(--shadow-lg);
  padding: 44px 36px 30px;
  min-height: 720px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.company-card {
  position: relative;
}
.company-card::before {
  content: none;
}
.company-logo {
  display: block;
  margin: 0 auto 14px auto;
  height: 240px;
  max-height: 240px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.company-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}
.company-subtitle {
  margin: 8px 0 22px;
  font-size: 13px;
  color: #64748b;
}
.company-list {
  width: 100%;
  display: grid;
  gap: 14px;
  margin-top: 10px;
}
.company-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-left: 4px solid transparent;
  border-radius: 10px;
  padding: 14px 14px 14px 12px;
  background: #ffffff;
  transition: transform .10s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
  will-change: transform;
}
.company-row:hover {
  border-color: #1d4ed8;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.10);
  transform: translateY(-1px);
}
.company-row[data-brand="strauss"] {
  border-left-color: rgba(29, 78, 216, 0.30);
}
.company-row[data-brand="group"] {
  border-left-color: rgba(220, 38, 38, 0.28);
}
.company-row.selected {
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
}
.company-row.selected[data-brand="strauss"] {
  border-left-color: rgba(29, 78, 216, 0.65);
}
.company-row.selected[data-brand="group"] {
  border-color: rgba(220, 38, 38, 0.55);
  background: #fef2f2;
  box-shadow: 0 12px 26px rgba(220, 38, 38, 0.10);
  border-left-color: rgba(220, 38, 38, 0.65);
}
.company-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #eff6ff;
  border: 1px solid #60a5fa;
  flex: 0 0 auto;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
}
.company-row[data-brand="group"] .company-icon {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}
.company-icon svg {
  display: block;
  stroke: currentColor;
  fill: none;
}
.company-info {
  flex: 1 1 auto;
  min-width: 0;
}
.company-name {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.company-row[data-brand="strauss"] .company-name {
  color: #1d4ed8;
}
.company-row[data-brand="group"] .company-name {
  color: #dc2626;
}
.company-cnpj {
  margin-top: 2px;
  font-size: 13px;
  color: #334155;
  font-weight: 500;
}
.btn-access {
  background: linear-gradient(180deg, var(--blue), var(--blue-700));
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 10px 16px rgba(37, 99, 235, 0.16);
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}
.btn-access:hover {
  filter: brightness(0.98);
  box-shadow: 0 12px 20px rgba(37, 99, 235, 0.20);
}
.btn-access:active {
  transform: translateY(1px);
}
.btn-access:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.75), 0 0 0 7px rgba(37, 99, 235, 0.26);
}
.company-row[data-brand="group"] .btn-access {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 10px 16px rgba(220, 38, 38, 0.14);
}
.company-row[data-brand="group"] .btn-access:hover {
  box-shadow: 0 12px 20px rgba(220, 38, 38, 0.18);
}
.btn-logout {
  margin-top: auto;
  background: transparent;
  border: 0;
  color: #64748b;
  font-weight: 700;
  cursor: pointer;
  padding: 12px 8px 0;
  font-size: 12px;
}
.dashboard-screen {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dashboard-card {
  width: 920px;
  max-width: 96vw;
  background: #ffffff;
  color: #0b1220;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 16px 30px rgba(0,0,0,0.16);
  padding: 18px 18px;
  min-height: 640px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5e7eb;
  padding: 6px 2px 14px;
}
.dashboard-company-name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}
.dashboard-company-cnpj {
  margin-top: 2px;
  font-size: 12px;
  color: #334155;
  font-weight: 500;
}
.dashboard-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.btn-secondary {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s ease, box-shadow .15s ease, transform .08s ease;
}
.btn-secondary:hover {
  filter: brightness(0.98);
}
.btn-secondary:active {
  transform: translateY(1px);
}
.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.28);
}
.dashboard-body {
  padding: 18px 2px 2px;
}
.dashboard-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.dashboard-section {
  margin-top: 18px;
}
.dashboard-section:first-of-type {
  margin-top: 0;
}
.dashboard-section-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.4px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dashboard-tile {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 14px;
  text-align: left;
  color: #0f172a;
  cursor: pointer;
}
.dashboard-tile:hover {
  border-color: rgba(15, 23, 42, 0.16);
}
.tile-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.tile-desc {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}
@media (max-width: 720px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Modo dashboard: ocupa a tela inteira e retira o padding da .container */
body.dashboard-mode .container {
  display: block;
  padding: 0;
}
body.dashboard-mode .dashboard-screen {
  display: block;
  width: 100%;
  min-height: 100vh;
}
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}
.sidebar {
  background:
    radial-gradient(560px 320px at 18% 0%, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0) 62%),
    radial-gradient(520px 300px at 88% 12%, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0) 62%),
    radial-gradient(620px 360px at 50% 110%, rgba(249, 115, 22, 0.10), rgba(249, 115, 22, 0) 62%),
    linear-gradient(180deg, #050b16, #0b1323);
  color: #2563eb;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  box-shadow: 18px 0 44px rgba(2, 6, 23, 0.28);
  position: relative;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 260px at 10% -10%, rgba(255,255,255,0.10), rgba(255,255,255,0) 60%),
    radial-gradient(700px 220px at 120% 0%, rgba(255,255,255,0.06), rgba(255,255,255,0) 65%);
  opacity: 0.95;
  pointer-events: none;
}
.sidebar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(255,255,255,0));
  opacity: 0.55;
  pointer-events: none;
}
body.dashboard-mode[data-brand="group"] .sidebar {
  background:
    radial-gradient(520px 280px at 20% 0%, rgba(220, 38, 38, 0.20), rgba(220, 38, 38, 0) 62%),
    radial-gradient(520px 280px at 85% 15%, rgba(37, 99, 235, 0.10), rgba(37, 99, 235, 0) 62%),
    linear-gradient(180deg, #050b16, #0b1323);
}
.sidebar-brand {
  height: 230px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: visible;
  z-index: 1;
}
.sidebar-logo-box {
  width: 100%;
  height: 198px;
  padding: 10px 12px;
  border-radius: 16px;
  background:
    radial-gradient(520px 240px at 0% 0%, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.32), inset 0 1px 0 rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-logo {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  max-width: 100%;
  object-position: center;
  filter: drop-shadow(0 14px 22px rgba(2, 6, 23, 0.28));
  display: block;
}
.sidebar-collapse { display: none; }
.sidebar-company {
  margin: 12px 12px 8px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    radial-gradient(520px 200px at 0% 0%, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.04));
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  position: relative;
  z-index: 1;
}
.sidebar-company-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: rgba(226, 232, 240, 0.92);
}
.sidebar-company-cnpj {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.70);
  font-weight: 500;
}
.sidebar-company {
  backdrop-filter: blur(6px);
}
.sidebar-nav {
  padding: 10px 10px 16px;
  overflow: auto;
  flex: 1 1 auto;
  scrollbar-color: rgba(148, 163, 184, 0.35) rgba(15, 23, 42, 0.4);
  scrollbar-width: thin;
  position: relative;
  z-index: 1;
}
.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  border: 2px solid rgba(5, 11, 22, 0.92);
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.34);
}
.nav-section {
  margin-top: 12px;
}
.nav-section:first-child {
  margin-top: 0;
}
.nav-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: rgba(226, 232, 240, 0.55);
  font-weight: 900;
  padding: 12px 10px 8px;
  text-transform: uppercase;
}
.nav-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.35);
}
.nav-title::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: rgba(255,255,255,0.07);
}
.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(226, 232, 240, 0.86);
  text-align: left;
  padding: 11px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  min-height: 44px;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.20);
  position: relative;
  z-index: 1;
}
.nav-badge-red { background: #dc2626; }
.nav-badge-blue { background: #2563eb; color: #ffffff; }
.nav-badge-orange { background: #f97316; }
.nav-item::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  transform: translateY(-50%);
  background:
    radial-gradient(120px 70px at 0% 0%, rgba(255,255,255,0.14), rgba(255,255,255,0) 58%),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255, 255, 255, 0.10);
  opacity: 0.95;
  z-index: 0;
}
.nav-ico {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  position: relative;
  z-index: 1;
  opacity: 0.92;
  filter: drop-shadow(0 8px 14px rgba(2, 6, 23, 0.22));
  transition: transform .12s ease, filter .15s ease, opacity .15s ease;
}
.nav-label {
  position: relative;
  z-index: 1;
}
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 16px 28px rgba(2, 6, 23, 0.26);
  color: #ffffff;
}
.nav-item:hover .nav-ico {
  opacity: 1;
  transform: translateY(-0.5px);
}
.nav-item:hover::before {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}
.nav-item:active {
  transform: translateY(1px);
}
.nav-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}
.nav-item.active {
  background:
    radial-gradient(520px 140px at 0% 0%, rgba(37, 99, 235, 0.20), rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05));
  color: #ffffff;
  position: relative;
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.30);
}
.nav-item.active::before {
  background:
    radial-gradient(120px 70px at 0% 0%, rgba(255,255,255,0.18), rgba(255,255,255,0) 58%),
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05));
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 14px 24px rgba(2, 6, 23, 0.26);
}
.nav-item.active .nav-ico {
  opacity: 1;
  filter: drop-shadow(0 12px 18px rgba(2, 6, 23, 0.30));
  transform: translateY(-0.5px);
}
.nav-item.active::after {
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-700));
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10), 0 12px 26px rgba(37, 99, 235, 0.26);
}
.nav-exit {
  color: rgba(226, 232, 240, 0.78);
}
.hi-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #2563eb;
  font-weight: 600;
  font-size: 9px;
  cursor: pointer;
  text-align: left;
}
.hi-link:hover {
  text-decoration: underline;
}
.hi-nfe-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.hi-nfe-wrap .hi-nfe {
  flex: 1 1 auto;
  min-width: 0;
}
.hi-save-btn {
  height: 28px;
  width: 34px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #2563eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.06), inset 0 1px 0 rgba(255,255,255,0.75);
  transition: transform .10s ease, box-shadow .18s ease, filter .15s ease;
}
.hi-save-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hi-save-btn:hover {
  filter: brightness(0.98);
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.10), inset 0 1px 0 rgba(255,255,255,0.80);
  transform: translateY(-1px);
}
.hi-save-btn:active { transform: translateY(0px); }
.hi-save-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  transform: none;
}
#page-historico-itens .td-actions {
  width: auto;
  text-align: center;
}
.sidebar-bottom {
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

body.sidebar-collapsed .app {
  grid-template-columns: 78px 1fr;
}
body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}
body.sidebar-collapsed .sidebar-logo {
  max-width: 70px;
  height: 70px;
  transform: none;
}
body.sidebar-collapsed .sidebar-company {
  display: none;
}
body.sidebar-collapsed .nav-title {
  display: none;
}
body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px 10px;
}
body.sidebar-collapsed .nav-item::before {
  left: 50%;
  transform: translate(-50%, -50%);
}
body.sidebar-collapsed .nav-label {
  display: none;
}
body.sidebar-collapsed .nav-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
}

.main {
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}
.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  padding: 0 22px;
  gap: 18px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.06);
  position: sticky;
  top: 0;
  z-index: 60;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(255,255,255,0));
  opacity: 0.55;
  pointer-events: none;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-date {
  font-size: 14px;
  font-weight: 800;
  color: rgba(71, 85, 105, 0.95);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 1);
  border: 1px solid rgba(15, 23, 42, 0.12);
  white-space: nowrap;
}
.topbar-date::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.22), rgba(148, 163, 184, 0.08));
  border: 1px solid rgba(15, 23, 42, 0.12);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: nowrap;
}
.topbar-btn {
  background: rgba(248, 250, 252, 1);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.06);
  transition: background-color .15s ease, box-shadow .15s ease, transform .08s ease, border-color .15s ease;
  white-space: nowrap;
}
.topbar-btn::before {
  content: none;
}
.topbar-btn:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.10);
}
.topbar-btn:active {
  transform: translateY(1px);
}
.topbar-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.topbar-user {
  text-align: right;
  line-height: 1.2;
  padding: 2px 4px;
  min-width: 0;
}
.topbar-user-role {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
}
.topbar-user-company {
  margin-top: 5px;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.topbar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-700));
  color: #ffffff;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 16px rgba(2, 6, 23, 0.18);
  transition: filter .15s ease, box-shadow .15s ease, transform .08s ease;
}
.topbar-avatar:hover {
  filter: brightness(0.98);
  box-shadow: 0 12px 22px rgba(2, 6, 23, 0.22);
}
.topbar-avatar:active {
  transform: translateY(1px);
}
.topbar-avatar:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9), 0 0 0 7px var(--accent-soft);
}

.content {
  padding: 20px;
  overflow: visible;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}
.content::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 220px at 14% 0%, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0) 60%),
    radial-gradient(620px 240px at 92% 12%, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0) 60%),
    radial-gradient(560px 220px at 60% 92%, rgba(249, 115, 22, 0.08), rgba(249, 115, 22, 0) 60%);
  pointer-events: none;
  opacity: 1;
}
body.dashboard-mode[data-brand="group"] .content::before {
  background:
    radial-gradient(520px 220px at 14% 0%, rgba(220, 38, 38, 0.12), rgba(220, 38, 38, 0) 60%),
    radial-gradient(620px 240px at 92% 12%, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0) 60%),
    radial-gradient(560px 220px at 60% 92%, rgba(249, 115, 22, 0.07), rgba(249, 115, 22, 0) 60%);
}
.content > * {
  position: relative;
}
.page-header {
  margin: 6px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}
.page-title::after {
  content: "";
  display: block;
  margin-top: 8px;
  height: 3px;
  width: 64px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.9;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.kpi-card {
  --kpi-accent: #2563eb;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.05);
  transition: transform .10s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: none;
}
.kpi-card[data-module] {
  cursor: pointer;
}
.kpi-card:active {
  transform: translateY(0px);
}
.kpi-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9), 0 0 0 7px var(--accent-soft), 0 10px 22px rgba(2, 6, 23, 0.08);
}
.kpi-card:hover {
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.08);
  transform: translateY(-1px);
}
.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 0;
  background: var(--kpi-accent);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}
.kpi-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}
.kpi-card[data-kpi="clientes"] { --kpi-accent: #2563eb; }
.kpi-card[data-kpi="produtos"] { --kpi-accent: #7c3aed; }
.kpi-card[data-kpi="vendas_mes"] { --kpi-accent: #16a34a; }
.kpi-card[data-kpi="compras_mes"] { --kpi-accent: #ea580c; }
.kpi-card[data-kpi="livro_caixa_mes"] { --kpi-accent: #059669; }
.kpi-purple, .kpi-green, .kpi-orange, .kpi-emerald, .kpi-blue { background: var(--kpi-accent); color: #ffffff; }
.kpi-text {
  min-width: 0;
  position: relative;
  padding-right: 76px;
  z-index: 1;
}
.kpi-label {
  font-size: 11px;
  color: rgba(100, 116, 139, 0.9);
  font-weight: 700;
}
.kpi-value {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}
.kpi-watermark {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.08;
  color: rgba(15, 23, 42, 0.18);
  z-index: 0;
}
.kpi-watermark svg {
  width: 72px;
  height: 72px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#page-visao-geral .kpi-row {
  gap: 14px;
}
#page-visao-geral .kpi-card {
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 74px;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.08);
  border-color: #e5e7eb;
}
#page-visao-geral .kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 120px at 0% 0%, color-mix(in srgb, var(--kpi-accent) 18%, transparent), transparent 58%),
    radial-gradient(480px 120px at 100% 0%, rgba(15, 23, 42, 0.06), transparent 56%);
  opacity: 1;
  pointer-events: none;
}
#page-visao-geral .kpi-card:hover {
  box-shadow: 0 22px 48px rgba(2, 6, 23, 0.12);
  transform: translateY(-2px);
}
#page-visao-geral .kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--kpi-accent) 92%, #ffffff), color-mix(in srgb, var(--kpi-accent) 82%, #000000));
  box-shadow: 0 16px 26px color-mix(in srgb, var(--kpi-accent) 18%, rgba(2, 6, 23, 0.18));
  border: 1px solid rgba(15, 23, 42, 0.12);
  position: relative;
  z-index: 1;
}
#page-visao-geral .kpi-label {
  font-weight: 800;
}
#page-visao-geral .kpi-value {
  font-size: 15px;
}
#page-visao-geral .kpi-watermark {
  opacity: 0.40;
}

.alert-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.alert {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.05);
  transition: transform .10s ease, box-shadow .18s ease, border-color .18s ease;
}
.alert:hover {
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.07);
  transform: translateY(-1px);
}
.alert-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-text {
  min-width: 0;
}
.alert-ico {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.55);
}
.alert-ico svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.alert-ico-green { color: #16a34a; border-color: rgba(22, 163, 74, 0.35); background: rgba(22, 163, 74, 0.12); }
.alert-ico-orange { color: #ea580c; border-color: rgba(234, 88, 12, 0.35); background: rgba(234, 88, 12, 0.12); }
.alert-ico-red { color: #dc2626; border-color: rgba(220, 38, 38, 0.35); background: rgba(220, 38, 38, 0.12); }
.alert-ico-blue { color: #2563eb; border-color: rgba(37, 99, 235, 0.35); background: rgba(37, 99, 235, 0.12); }
.alert-btn {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  flex: 0 0 auto;
  transition: filter .15s ease, box-shadow .15s ease, transform .08s ease, background-color .15s ease;
}
.alert-btn:hover {
  filter: brightness(0.98);
}
.alert-btn:active {
  transform: translateY(1px);
}
.alert-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.alert-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.alert-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.alert-green { background: #ecfdf5; border-color: #bbf7d0; }
.alert-orange { background: #fff7ed; border-color: #fed7aa; }
.alert-red { background: #fef2f2; border-color: #fecaca; }
.alert-blue { background: #eff6ff; border-color: #bfdbfe; }

#page-visao-geral .alert-row {
  margin-top: 14px;
  gap: 14px;
}
#page-visao-geral .alert {
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 20px 46px rgba(2, 6, 23, 0.10);
  border-color: rgba(148, 163, 184, 0.35);
  position: relative;
  overflow: hidden;
}
#page-visao-geral .alert:hover {
  box-shadow: 0 22px 48px rgba(2, 6, 23, 0.12);
  transform: translateY(-2px);
}
#page-visao-geral .alert::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  pointer-events: none;
  opacity: 0.9;
}
#page-visao-geral .alert::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 180px at 0% 0%, rgba(15, 23, 42, 0.06), rgba(255, 255, 255, 0) 60%),
    radial-gradient(420px 180px at 100% 0%, rgba(15, 23, 42, 0.05), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
  opacity: 0.85;
}
#page-visao-geral .alert > * {
  position: relative;
  z-index: 1;
}

#page-visao-geral .alert-green {
  background:
    radial-gradient(520px 200px at 0% 0%, rgba(34, 197, 94, 0.18), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(236, 253, 245, 0.95), rgba(255, 255, 255, 0.92));
  border-color: rgba(34, 197, 94, 0.22);
}
#page-visao-geral .alert-green::before {
  background: linear-gradient(180deg, rgba(34, 197, 94, 1), rgba(22, 163, 74, 1));
}
#page-visao-geral .alert-orange {
  background:
    radial-gradient(520px 200px at 0% 0%, rgba(249, 115, 22, 0.18), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(255, 247, 237, 0.95), rgba(255, 255, 255, 0.92));
  border-color: rgba(249, 115, 22, 0.24);
}
#page-visao-geral .alert-orange::before {
  background: linear-gradient(180deg, rgba(249, 115, 22, 1), rgba(234, 88, 12, 1));
}
#page-visao-geral .alert-red {
  background:
    radial-gradient(520px 200px at 0% 0%, rgba(220, 38, 38, 0.18), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(254, 242, 242, 0.95), rgba(255, 255, 255, 0.92));
  border-color: rgba(220, 38, 38, 0.24);
}
#page-visao-geral .alert-red::before {
  background: linear-gradient(180deg, rgba(220, 38, 38, 1), rgba(185, 28, 28, 1));
}
#page-visao-geral .alert-blue {
  background:
    radial-gradient(520px 200px at 0% 0%, rgba(37, 99, 235, 0.18), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.92));
  border-color: rgba(148, 163, 184, 0.35);
}
#page-visao-geral .alert-blue::before {
  background: linear-gradient(180deg, rgba(37, 99, 235, 1), rgba(29, 78, 216, 1));
}

#page-visao-geral .alert-ico {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  box-shadow: 0 16px 28px rgba(2, 6, 23, 0.10), inset 0 1px 0 rgba(255,255,255,0.85);
  background: rgba(255, 255, 255, 0.8);
}
#page-visao-geral .alert-ico svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}
#page-visao-geral .alert-ico-green { background: linear-gradient(180deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.10)); }
#page-visao-geral .alert-ico-orange { background: linear-gradient(180deg, rgba(249, 115, 22, 0.18), rgba(249, 115, 22, 0.10)); }
#page-visao-geral .alert-ico-red { background: linear-gradient(180deg, rgba(220, 38, 38, 0.18), rgba(220, 38, 38, 0.10)); }
#page-visao-geral .alert-ico-blue { background: linear-gradient(180deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.10)); }

#page-visao-geral .alert-title {
  font-weight: 900;
  letter-spacing: 0.2px;
}
#page-visao-geral .alert-sub {
  font-weight: 800;
  color: rgba(100, 116, 139, 0.95);
}

#page-visao-geral .alert-btn {
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.30);
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.12), inset 0 1px 0 rgba(255,255,255,0.90);
  font-weight: 900;
}
#page-visao-geral .alert-btn:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(148, 163, 184, 0.35);
  filter: none;
}

.panel {
  margin-top: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 12px;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.04);
}

#page-visao-geral .panel {
  border-radius: 14px;
  border-color: #e5e7eb;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.07);
  padding: 14px 16px;
}
#page-visao-geral .panel-title {
  font-weight: 900;
}
#page-visao-geral #financeChart {
  border-radius: 14px;
  border-color: #e5e7eb;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.07);
}
#page-visao-geral #financeChart .chart-head-title {
  font-weight: 900;
  letter-spacing: 0.2px;
}
#page-visao-geral #financeChart .chart-head {
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 6px;
}
#page-visao-geral #financeChart .chart-head-ico {
  width: 18px;
  height: 18px;
  padding: 7px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.10);
}
#page-visao-geral #financeChart .finance-plot {
  background:
    radial-gradient(560px 240px at 0% 0%, rgba(37, 99, 235, 0.10), rgba(255, 255, 255, 0) 55%),
    radial-gradient(560px 240px at 100% 0%, rgba(15, 23, 42, 0.06), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  border-color: #e5e7eb;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 18px 40px rgba(2, 6, 23, 0.07);
}
#page-visao-geral #financeChart .finance-plot::before {
  content: "";
  position: absolute;
  inset: var(--plot-pad);
  bottom: var(--plot-xaxis);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.06), rgba(255, 255, 255, 0) 40%),
    linear-gradient(90deg, rgba(148, 163, 184, 0.10) 1px, rgba(255, 255, 255, 0) 1px);
  background-size: 100% 100%, calc(100% / 6) 100%;
  background-position: 0 0, 0 0;
  pointer-events: none;
  opacity: 0.85;
}
#page-visao-geral #financeChart .grid-line {
  background: rgba(148, 163, 184, 0.16);
}
#page-visao-geral #financeChart .month::before {
  background: rgba(2, 6, 23, 0.04);
}

#page-visao-geral .vg-reminders-panel {
  background:
    radial-gradient(520px 240px at 0% 0%, rgba(37, 99, 235, 0.10), rgba(255, 255, 255, 0) 55%),
    radial-gradient(520px 240px at 100% 0%, rgba(34, 197, 94, 0.08), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  border-color: #e5e7eb;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 18px 40px rgba(2, 6, 23, 0.07);
}
#page-visao-geral .vg-reminders-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
}
#page-visao-geral .vg-reminders-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#page-visao-geral .vg-reminders-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.10);
  color: rgba(15, 23, 42, 0.90);
  font-weight: 900;
  white-space: nowrap;
}
#page-visao-geral .vg-reminders-chip-k {
  font-size: 11px;
  color: rgba(100, 116, 139, 0.95);
}
#page-visao-geral .vg-reminders-chip-v {
  font-size: 12px;
  color: #0f172a;
}
#page-visao-geral .vg-reminders-chip-warn {
  background: rgba(249, 115, 22, 0.10);
  border-color: rgba(249, 115, 22, 0.22);
}
#page-visao-geral .vg-reminders-chip-danger {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.22);
}
#page-visao-geral .vg-reminders-chip-muted {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.20);
}
#page-visao-geral .vg-reminders-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.14);
  color: rgba(30, 58, 138, 1);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
#page-visao-geral .vg-reminders-due {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.10);
  font-size: 11px;
  font-weight: 900;
  color: rgba(51, 65, 85, 0.95);
}
#page-visao-geral .vg-reminders-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.05);
}

#page-visao-geral .vg-reminders-table .rm-blink td,
#page-lembretes .table .rm-blink td {
  animation: rm-blink-bg 0.72s ease-in-out infinite;
  border-top-color: rgba(220, 38, 38, 0.28);
  border-bottom-color: rgba(220, 38, 38, 0.28);
}
@keyframes rm-blink-bg {
  0%, 100% {
    background: rgba(239, 68, 68, 0.08);
    box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0.00);
  }
  50% {
    background: rgba(239, 68, 68, 0.35);
    box-shadow: inset 0 0 0 999px rgba(255, 59, 48, 0.08), 0 0 16px rgba(239, 68, 68, 0.40);
  }
}
@media (prefers-reduced-motion: reduce) {
  #page-visao-geral .vg-reminders-table .rm-blink td,
  #page-lembretes .table .rm-blink td { animation: none; }
}

@media (max-width: 980px) {
  #page-visao-geral .vg-reminders-meta { align-items: flex-start; }
}
#page-visao-geral #financeChart .chart-bar {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
#page-visao-geral #financeChart .chart-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 32%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.40), rgba(255, 255, 255, 0));
  pointer-events: none;
  opacity: 0.9;
}
#page-visao-geral #financeChart .chart-in {
  border-color: rgba(34, 197, 94, 0.35);
}
#page-visao-geral #financeChart .chart-out {
  border-color: rgba(249, 115, 22, 0.35);
}
#page-visao-geral #quotesChart .chart-bar {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
#page-visao-geral #quotesChart .chart-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 32%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.40), rgba(255, 255, 255, 0));
  pointer-events: none;
  opacity: 0.9;
}
#page-visao-geral #financeChart .finance-legend {
  gap: 10px;
}
#page-visao-geral #financeChart .legend-item {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 1);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 22px rgba(2, 6, 23, 0.08);
}
#page-visao-geral #financeChart .legend-dot {
  width: 10px;
  height: 10px;
}

#page-visao-geral .panel-top {
  position: relative;
  overflow: hidden;
  padding: 10px 12px;
}
#page-visao-geral .panel-top::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: rgba(148, 163, 184, 0.35);
}
#page-visao-geral .panel-top-products::before {
  background: linear-gradient(90deg, rgba(29, 78, 216, 1), rgba(109, 40, 217, 1));
}
#page-visao-geral .panel-top-clients::before {
  background: linear-gradient(90deg, rgba(37, 99, 235, 1), rgba(29, 78, 216, 1));
}
#page-visao-geral .panel-top-suppliers::before {
  background: linear-gradient(90deg, rgba(249, 115, 22, 1), rgba(234, 88, 12, 1));
}
#page-visao-geral .panel-top .panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 950;
  letter-spacing: 0.2px;
}
#page-visao-geral .panel-top .rank-list {
  gap: 8px;
}
#page-visao-geral .panel-top .rank-item {
  grid-template-columns: 24px 1fr auto;
  padding: 9px 9px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background:
    radial-gradient(520px 140px at 0% 0%, rgba(15, 23, 42, 0.06), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.08);
  transition: transform .10s ease, box-shadow .18s ease, border-color .18s ease;
}
#page-visao-geral .panel-top .rank-item:hover {
  box-shadow: 0 22px 48px rgba(2, 6, 23, 0.12);
  border-color: rgba(148, 163, 184, 0.45);
  transform: translateY(-1px);
}
#page-visao-geral .panel-top .rank-n {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.06);
  box-shadow: 0 12px 22px rgba(2, 6, 23, 0.08), inset 0 1px 0 rgba(255,255,255,0.80);
  color: rgba(15, 23, 42, 0.92);
}
#page-visao-geral .panel-top-products .rank-n {
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.22), rgba(29, 78, 216, 0.10));
  border-color: rgba(148, 163, 184, 0.35);
  color: rgba(109, 40, 217, 1);
}
#page-visao-geral .panel-top-clients .rank-n {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0.10));
  border-color: rgba(148, 163, 184, 0.35);
  color: rgba(29, 78, 216, 1);
}
#page-visao-geral .panel-top-suppliers .rank-n {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.22), rgba(249, 115, 22, 0.10));
  border-color: rgba(249, 115, 22, 0.26);
  color: rgba(234, 88, 12, 1);
}
#page-visao-geral .panel-top .rank-name {
  font-weight: 900;
  font-size: 10.5px;
}
#page-visao-geral .panel-top .rank-val {
  font-weight: 950;
}
#page-visao-geral .panel-top .rank-bar {
  height: 6px;
  background: rgba(148, 163, 184, 0.18);
}
#page-visao-geral .panel-top .rank-bar > span {
  position: relative;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.10);
  overflow: hidden;
}
#page-visao-geral .panel-top .rank-bar > span::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 38%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
  opacity: 0.9;
  pointer-events: none;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toolbar-sub {
  margin-top: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.table-meta {
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  color: rgba(100, 116, 139, 0.9);
}
.toolbar .input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
}
.client-form {
  display: grid;
  gap: 10px;
}
.perm-group {
  border: 1px solid rgba(2, 6, 23, 0.10);
  background: rgba(248, 250, 252, 0.72);
  border-radius: 12px;
  padding: 12px;
}
.perm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.perm-title {
  font-weight: 900;
  font-size: 12px;
  color: #0f172a;
}
.perm-sub {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(100, 116, 139, 0.95);
}
.perm-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.btn-secondary.perm-btn {
  padding: 8px 10px;
  font-size: 11px;
  border-radius: 10px;
}
.perm-search {
  min-width: min(260px, 60vw);
  padding: 9px 10px !important;
  font-size: 12px !important;
}
.perm-meta {
  font-size: 11px;
  font-weight: 800;
  color: rgba(100, 116, 139, 0.95);
  margin-top: 2px;
}
.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.perm-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 10px;
  border: 1px solid rgba(2, 6, 23, 0.10);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}
.perm-item:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.06);
}
.perm-item:active {
  transform: translateY(1px);
}
.perm-item input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--accent);
}
.perm-item .perm-name {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.15;
}
.perm-item .perm-desc {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(100, 116, 139, 0.95);
  line-height: 1.25;
}
.perm-item:has(input[type="checkbox"]:focus-visible) {
  box-shadow: 0 0 0 3px var(--ring);
  border-color: rgba(37, 99, 235, 0.45);
}
.perm-solo {
  grid-template-columns: 1fr;
}
.segmented {
  display: inline-flex;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  overflow: hidden;
}
.seg-btn {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 900;
  color: #334155;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.seg-btn.active {
  background: rgba(37, 99, 235, 0.14);
  color: #0f172a;
}
.seg-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.24);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 10px;
}
.form-grid-3-simple {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 6px;
}
.form-section-title {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.1px;
  color: rgba(100, 116, 139, 0.85);
}
.form-footer {
  margin-top: 6px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.form-id {
  width: 140px;
}
@media (max-width: 720px) {
  .form-grid,
  .form-grid-3,
  .form-grid-3-simple {
    grid-template-columns: 1fr;
  }
  .perm-grid {
    grid-template-columns: 1fr;
  }
  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .form-id {
    width: 100%;
  }
  .form-actions {
    justify-content: flex-end;
  }
}
.table-wrapper {
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}
.table-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}
.pager {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(100, 116, 139, 0.9);
}
.pager .btn-secondary {
  padding: 8px 12px;
  font-size: 12px;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 12px;
}
.t-right { text-align: right; }
.table thead th.th-sort {
  cursor: pointer;
  user-select: none;
  position: relative;
}
.table thead th.th-sort::after {
  content: "";
  display: inline-block;
  margin-left: 8px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid rgba(100, 116, 139, 0.55);
  transform: translateY(-1px);
  opacity: 0.55;
}
.table thead th.th-sort[data-sort-dir="asc"]::after {
  border-top: 0;
  border-bottom: 6px solid rgba(100, 116, 139, 0.75);
  opacity: 1;
}
.table thead th.th-sort[data-sort-dir="desc"]::after {
  border-top: 6px solid rgba(100, 116, 139, 0.75);
  opacity: 1;
}
.table tbody td {
  font-size: 12px;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 12px;
  vertical-align: top;
}
.table thead th:nth-child(2),
.table tbody td:nth-child(2) {
  white-space: normal;
  word-break: break-word;
}
.table thead th:not(:nth-child(2)),
.table tbody td:not(:nth-child(2)) {
  white-space: nowrap;
}
#page-historico-itens .table thead th:nth-child(5),
#page-historico-itens .table tbody td:nth-child(5),
#page-historico-itens .table thead th:nth-child(6),
#page-historico-itens .table tbody td:nth-child(6) {
  white-space: normal;
  word-break: break-word;
}
#page-historico-itens .hi-nfe {
  height: 28px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 9px;
  background: rgba(248, 250, 252, 1);
}
#page-historico-itens .table-wrapper { overflow: hidden; }
#page-historico-itens .table { width: 100%; table-layout: fixed; }
#page-historico-itens .table thead th,
#page-historico-itens .table tbody td {
  white-space: normal;
  word-break: break-word;
}
#page-historico-itens .hi-col-product,
#page-historico-itens .hi-col-desc {
  min-width: 0;
}
#page-historico-itens .table thead th:nth-child(1),
#page-historico-itens .table tbody td:nth-child(1) { width: 52px; }
#page-historico-itens .table thead th:nth-child(2),
#page-historico-itens .table tbody td:nth-child(2) { width: 82px; }
#page-historico-itens .table thead th:nth-child(3),
#page-historico-itens .table tbody td:nth-child(3) { width: 96px; }
#page-historico-itens .table thead th:nth-child(4),
#page-historico-itens .table tbody td:nth-child(4) { width: 170px; }
#page-historico-itens .table thead th:nth-child(5),
#page-historico-itens .table tbody td:nth-child(5) { width: 150px; }
#page-historico-itens .table thead th:nth-child(8),
#page-historico-itens .table tbody td:nth-child(8) { width: 92px; }
#page-historico-itens .table thead th:nth-child(9),
#page-historico-itens .table tbody td:nth-child(9) { width: 92px; }
#page-historico-itens .table thead th:nth-child(10),
#page-historico-itens .table tbody td:nth-child(10) { width: 95px; }
#page-historico-itens .table thead th:nth-child(11),
#page-historico-itens .table tbody td:nth-child(11) { width: 44px; }
#page-historico-itens .table thead th:nth-child(12),
#page-historico-itens .table tbody td:nth-child(12) { width: 90px; }
#page-historico-itens .table thead th:nth-child(13),
#page-historico-itens .table tbody td:nth-child(13) { width: 64px; }
#page-historico-itens .table thead th:nth-child(14),
#page-historico-itens .table tbody td:nth-child(14) { width: 76px; }
#page-historico-itens .table thead th {
  font-size: 10px;
  padding: 8px 9px;
}
#page-historico-itens .table tbody td {
  font-size: 10px;
  padding: 8px 9px;
  vertical-align: top;
}
#page-historico-itens .hi-nfe {
  height: 24px;
  padding: 4px 8px;
  font-size: 10px;
}
#page-historico-itens .hi-save-btn {
  height: 24px;
  width: 30px;
  border-radius: 8px;
}
#page-historico-itens .hi-save-btn svg {
  width: 14px;
  height: 14px;
}
#page-historico-itens .table thead th:nth-child(8),
#page-historico-itens .table tbody td:nth-child(8),
#page-historico-itens .table thead th:nth-child(9),
#page-historico-itens .table tbody td:nth-child(9),
#page-historico-itens .table thead th:nth-child(10),
#page-historico-itens .table tbody td:nth-child(10),
#page-historico-itens .table thead th:nth-child(11),
#page-historico-itens .table tbody td:nth-child(11),
#page-historico-itens .table thead th:nth-child(12),
#page-historico-itens .table tbody td:nth-child(12),
#page-historico-itens .table thead th:nth-child(13),
#page-historico-itens .table tbody td:nth-child(13),
#page-historico-itens .table thead th:nth-child(14),
#page-historico-itens .table tbody td:nth-child(14) {
  white-space: nowrap;
}

#page-historico-itens .table thead th:nth-child(8),
#page-historico-itens .table tbody td:nth-child(8),
#page-historico-itens .table thead th:nth-child(9),
#page-historico-itens .table tbody td:nth-child(9),
#page-historico-itens .table thead th:nth-child(11),
#page-historico-itens .table tbody td:nth-child(11),
#page-historico-itens .table thead th:nth-child(12),
#page-historico-itens .table tbody td:nth-child(12),
#page-historico-itens .table thead th:nth-child(13),
#page-historico-itens .table tbody td:nth-child(13) {
  text-align: right;
}

#page-historico-itens .table thead th:nth-child(14),
#page-historico-itens .table tbody td:nth-child(14) {
  text-align: center;
}
#page-produtos .table-wrapper,
#page-produtos-vendidos .table-wrapper {
  overflow: auto;
}
#page-produtos .table,
#page-produtos-vendidos .table {
  table-layout: auto;
  min-width: 0;
}
#page-produtos .table thead th,
#page-produtos .table tbody td,
#page-produtos-vendidos .table thead th,
#page-produtos-vendidos .table tbody td {
  white-space: nowrap;
}
#page-produtos .table thead th:nth-child(1),
#page-produtos .table tbody td:nth-child(1),
#page-produtos-vendidos .table thead th:nth-child(1),
#page-produtos-vendidos .table tbody td:nth-child(1) {
  width: 56px;
}
#page-produtos .table thead th:nth-child(2),
#page-produtos .table tbody td:nth-child(2),
#page-produtos-vendidos .table thead th:nth-child(2),
#page-produtos-vendidos .table tbody td:nth-child(2) {
  width: auto;
}
#page-produtos .table tbody td:nth-child(2),
#page-produtos .table tbody td:nth-child(3),
#page-produtos-vendidos .table tbody td:nth-child(2),
#page-produtos-vendidos .table tbody td:nth-child(3) {
  white-space: normal;
  word-break: break-word;
}
#page-produtos .table thead th:nth-child(4),
#page-produtos .table tbody td:nth-child(4),
#page-produtos-vendidos .table thead th:nth-child(4),
#page-produtos-vendidos .table tbody td:nth-child(4) {
  width: 104px;
  text-align: right;
  white-space: nowrap;
}
#page-produtos .table thead th:nth-child(5),
#page-produtos .table tbody td:nth-child(5),
#page-produtos-vendidos .table thead th:nth-child(5),
#page-produtos-vendidos .table tbody td:nth-child(5) {
  width: 104px;
  text-align: right;
}
#page-produtos .table thead th:nth-child(6),
#page-produtos-vendidos .table thead th:nth-child(6) {
  text-align: right;
}
#page-produtos .table thead th:nth-child(4),
#page-produtos .table tbody td:nth-child(4),
#page-produtos .table thead th:nth-child(5),
#page-produtos .table tbody td:nth-child(5),
#page-produtos-vendidos .table thead th:nth-child(4),
#page-produtos-vendidos .table tbody td:nth-child(4),
#page-produtos-vendidos .table thead th:nth-child(5),
#page-produtos-vendidos .table tbody td:nth-child(5) {
  font-variant-numeric: tabular-nums;
  padding-left: 8px;
  padding-right: 10px;
}

#page-produtos .table thead th:nth-child(4),
#page-produtos .table thead th:nth-child(5),
#page-produtos-vendidos .table thead th:nth-child(4),
#page-produtos-vendidos .table thead th:nth-child(5) {
  text-align: right;
}

#page-produtos .table thead th:last-child,
#page-produtos .table tbody td:last-child,
#page-produtos-vendidos .table thead th:last-child,
#page-produtos-vendidos .table tbody td:last-child {
  text-align: right;
}

#page-produtos .table tbody td.td-actions,
#page-produtos-vendidos .table tbody td.td-actions {
  width: 120px;
}

#page-produtos .row-actions,
#page-produtos-vendidos .row-actions {
  justify-content: flex-end;
}
.table tbody td.td-actions {
  width: 156px;
  text-align: right;
}
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.row-btn {
  --btn-accent: 15, 23, 42;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.72);
  color: rgb(var(--btn-accent));
  border-radius: 10px;
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .10s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.06), inset 0 1px 0 rgba(255,255,255,0.75);
}
.row-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}
.row-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.12), inset 0 1px 0 rgba(255,255,255,0.80);
}
.row-btn:active {
  transform: translateY(0px);
}
.row-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(var(--btn-accent), 0.18), 0 14px 26px rgba(2, 6, 23, 0.12);
}
.row-btn-view {
  --btn-accent: 22, 163, 74;
  border-color: rgba(22, 163, 74, 0.22);
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.12), rgba(22, 163, 74, 0.07));
}
.row-btn-view:hover {
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.16), rgba(22, 163, 74, 0.09));
}
.row-btn-edit {
  --btn-accent: 29, 78, 216;
  border-color: rgba(29, 78, 216, 0.20);
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.12), rgba(29, 78, 216, 0.07));
}
.row-btn-edit:hover {
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.16), rgba(29, 78, 216, 0.09));
}
.row-btn-delete {
  --btn-accent: 220, 38, 38;
  border-color: rgba(220, 38, 38, 0.22);
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.12), rgba(220, 38, 38, 0.07));
}
.row-btn-delete:hover {
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.16), rgba(220, 38, 38, 0.09));
}
.row-btn-ok {
  --btn-accent: 22, 163, 74;
  border-color: rgba(22, 163, 74, 0.22);
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.12), rgba(22, 163, 74, 0.07));
}
.row-btn-ok:hover {
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.16), rgba(22, 163, 74, 0.09));
}
.row-btn-danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
}
.btn-danger {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(180deg, #ef4444, #dc2626);
  box-shadow: 0 12px 22px rgba(220, 38, 38, 0.18);
  transition: filter .15s ease, transform .08s ease, box-shadow .15s ease;
}
.btn-danger:hover {
  filter: brightness(0.99);
  box-shadow: 0 14px 26px rgba(220, 38, 38, 0.22);
}
.btn-danger:active {
  transform: translateY(1px);
}
.btn-danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.18), 0 14px 26px rgba(220, 38, 38, 0.22);
}
.table tbody tr:hover td {
  background: #f8fafc;
}
.table-empty {
  padding: 14px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.panel-chart {
  position: relative;
  overflow: hidden;
}
.panel-chart::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0));
  pointer-events: none;
  opacity: 1;
}
.panel-chart > * {
  position: relative;
}
.chart-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chart-head-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-head-title {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.finance-chart {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: stretch;
}
.finance-y {
  height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: rgba(100, 116, 139, 0.8);
  padding: 2px 0 18px;
  user-select: none;
}
.finance-plot {
  position: relative;
  height: 260px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #ffffff);
  border: 1px solid rgba(15, 23, 42, 0.12);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  --plot-pad: 12px;
  --plot-xaxis: 32px;
}
.finance-plot::after {
  content: "";
  position: absolute;
  left: var(--plot-pad);
  right: var(--plot-pad);
  bottom: var(--plot-xaxis);
  height: 1px;
  background: rgba(148, 163, 184, 0.22);
  pointer-events: none;
}
.finance-grid {
  position: absolute;
  inset: var(--plot-pad) var(--plot-pad) var(--plot-xaxis) var(--plot-pad);
  pointer-events: none;
}
.grid-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--p) * 100%);
  height: 1px;
  background: rgba(148, 163, 184, 0.12);
}
.finance-bars {
  position: absolute;
  inset: var(--plot-pad) var(--plot-pad) 10px var(--plot-pad);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.month {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  user-select: none;
  position: relative;
  z-index: 1;
}
.month::before {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  top: -10px;
  bottom: 18px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.03);
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
.month:hover::before {
  opacity: 1;
}
.month-pair,
.month-label {
  position: relative;
  z-index: 2;
}
.month:hover .chart-bar {
  filter: brightness(1.04);
}
.month-pair {
  width: 100%;
  height: 210px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
}
.month-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(100, 116, 139, 0.85);
  letter-spacing: 0.2px;
}
.chart-bar {
  width: 62px;
  max-width: 46%;
  height: 0%;
  border-radius: 12px 12px 4px 4px;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.10);
  transition: height .55s cubic-bezier(.2,.8,.2,1), filter .15s ease, transform .12s ease;
  cursor: pointer;
}
.chart-bar:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
}
.chart-in {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95));
}
.chart-out {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.95), rgba(234, 88, 12, 0.95));
}
.chart-quotes {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.95), rgba(79, 70, 229, 0.95));
}
.finance-legend {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(100, 116, 139, 0.9);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}
.legend-dot-in { background: #22c55e; }
.legend-dot-out { background: #f97316; }
.legend-dot-quotes { background: #6366f1; }
.panel-title {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.panel-head .panel-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

#page-contas-pagar tr.is-overdue,
#page-contas-receber tr.is-overdue {
  background: rgba(239, 68, 68, 0.06);
}
#page-contas-pagar tr.is-overdue td:nth-child(2),
#page-contas-receber tr.is-overdue td:nth-child(2) {
  color: #dc2626;
  font-weight: 900;
}
#page-contas-pagar tr.is-paid,
#page-contas-receber tr.is-paid {
  background: rgba(34, 197, 94, 0.04);
}

#page-contas-pagar .panel-sub,
#page-contas-receber .panel-sub {
  display: none;
}

.panel-title-ico {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.panel-title-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}
.panel-title-ico-pay { stroke: #dc2626; }
.panel-title-ico-rec { stroke: #2563eb; }

.finance-toolbar {
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.06);
}
.finance-searchbar { flex: 1 1 auto; min-width: 280px; }
.finance-date { width: 110px; flex: 0 0 auto; }
.finance-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.finance-label {
  font-size: 12px;
  font-weight: 900;
  color: rgba(100, 116, 139, 0.9);
  white-space: nowrap;
}

#page-contas-pagar .badge-warn,
#page-contas-receber .badge-warn {
  color: #854d0e;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.26);
}

#page-contas-pagar .row-btn-view,
#page-contas-receber .row-btn-view {
  --btn-accent: 100, 116, 139;
  border-color: rgba(100, 116, 139, 0.22);
  background: linear-gradient(180deg, rgba(100, 116, 139, 0.10), rgba(100, 116, 139, 0.06));
}
#page-contas-pagar .row-btn-view:hover,
#page-contas-receber .row-btn-view:hover {
  background: linear-gradient(180deg, rgba(100, 116, 139, 0.14), rgba(100, 116, 139, 0.08));
}

#page-contas-pagar .kpi-card .kpi-wm,
#page-contas-receber .kpi-card .kpi-wm {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.14;
  pointer-events: none;
}
#page-contas-pagar .kpi-card .kpi-wm svg,
#page-contas-receber .kpi-card .kpi-wm svg {
  width: 54px;
  height: 54px;
  stroke: rgba(15, 23, 42, 0.35);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#page-contas-pagar .seg-btn.active,
#page-contas-receber .seg-btn.active {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.10);
}
.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cell-subtle {
  font-size: 11px;
  color: rgba(100,116,139,.92);
  font-weight: 700;
}
.cell-link {
  color: #2563eb;
  font-weight: 700;
}
.form-help {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(100, 116, 139, 0.95);
}

#page-livro-caixa .panel-title-ico svg { stroke: #2563eb; }
#page-livro-caixa .finance-toolbar {
  margin-top: 8px;
}
#page-livro-caixa .table thead th:nth-child(1),
#page-livro-caixa .table tbody td:nth-child(1) { width: 110px; }
#page-livro-caixa .table thead th:nth-child(2),
#page-livro-caixa .table tbody td:nth-child(2) { width: 94px; }
#page-livro-caixa .table thead th:nth-child(3),
#page-livro-caixa .table tbody td:nth-child(3),
#page-livro-caixa .table thead th:nth-child(4),
#page-livro-caixa .table tbody td:nth-child(4) { width: 140px; }
#page-livro-caixa .table thead th:nth-child(7),
#page-livro-caixa .table tbody td:nth-child(7) { width: 96px; text-align: center; }

#page-certificados .finance-toolbar {
  margin-top: 8px;
}
#page-certificados .table thead th:nth-child(1),
#page-certificados .table tbody td:nth-child(1) { width: 120px; }
#page-certificados .table thead th:nth-child(3),
#page-certificados .table tbody td:nth-child(3) { width: 220px; }
#page-certificados .table thead th:nth-child(4),
#page-certificados .table tbody td:nth-child(4) { width: 200px; }
#page-certificados .table thead th:nth-child(5),
#page-certificados .table tbody td:nth-child(5) { width: 110px; text-align: center; }
#page-certificados .table thead th:nth-child(6),
#page-certificados .table tbody td:nth-child(6) { width: 130px; }
#page-certificados .table thead th:nth-child(7),
#page-certificados .table tbody td:nth-child(7) { width: 120px; text-align: center; }
.cf-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cf-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 800;
}
.cf-file-chip[data-open="1"] {
  cursor: pointer;
  border: 0;
}
.cf-file-chip[data-open="1"][data-active="1"] {
  background: rgba(37, 99, 235, 0.22);
}
.cf-file-chip button {
  border: 0;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

#page-estoque .panel-title-ico svg { stroke: #2563eb; }

#page-estoque .kpi-card .kpi-wm {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.14;
  pointer-events: none;
}
#page-estoque .kpi-card .kpi-wm svg {
  width: 54px;
  height: 54px;
  stroke: rgba(15, 23, 42, 0.35);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#page-estoque .stock-summary {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 14px;
  margin-top: 10px;
  align-items: stretch;
}
#page-estoque .stock-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
#page-estoque .stock-add-card {
  border: 2px dashed rgba(37, 99, 235, 0.30);
  background: rgba(37, 99, 235, 0.03);
  border-radius: 14px;
  font-weight: 900;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}
#page-estoque .stock-add-plus {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  font-size: 18px;
  line-height: 1;
}
#page-estoque .panel-subtitle {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}
#page-estoque .stock-tools {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#page-estoque .table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  #page-estoque .stock-summary { grid-template-columns: 1fr; }
  #page-estoque .stock-kpis { grid-template-columns: 1fr; }
}

#page-usuarios .finance-toolbar {
  margin-top: 8px;
}
#page-usuarios .table thead th:nth-child(2),
#page-usuarios .table tbody td:nth-child(2) {
  width: 140px;
  white-space: nowrap;
}
#page-usuarios .table thead th:nth-child(4),
#page-usuarios .table tbody td:nth-child(4) {
  width: 140px;
}
#page-usuarios .table thead th:nth-child(5),
#page-usuarios .table tbody td:nth-child(5) {
  width: 95px;
}
#page-usuarios .table thead th:nth-child(6),
#page-usuarios .table tbody td:nth-child(6) {
  width: 140px;
  white-space: nowrap;
}
#page-usuarios .table thead th:nth-child(7),
#page-usuarios .table tbody td:nth-child(7) {
  width: 120px;
  text-align: center;
}

#page-agenda-telefonica .finance-toolbar,
#page-lembretes .finance-toolbar {
  margin-top: 8px;
}
#page-agenda-telefonica .table thead th:nth-child(1),
#page-agenda-telefonica .table tbody td:nth-child(1) { width: 190px; }
#page-agenda-telefonica .table thead th:nth-child(3),
#page-agenda-telefonica .table tbody td:nth-child(3),
#page-agenda-telefonica .table thead th:nth-child(4),
#page-agenda-telefonica .table tbody td:nth-child(4) {
  width: 140px;
  white-space: nowrap;
}
#page-agenda-telefonica .table thead th:nth-child(6),
#page-agenda-telefonica .table tbody td:nth-child(6) { width: 140px; }
#page-agenda-telefonica .table thead th:nth-child(7),
#page-agenda-telefonica .table tbody td:nth-child(7) { width: 110px; }
#page-agenda-telefonica .table thead th:nth-child(8),
#page-agenda-telefonica .table tbody td:nth-child(8) {
  width: 120px;
  text-align: center;
}

#page-lembretes .table thead th:nth-child(1),
#page-lembretes .table tbody td:nth-child(1),
#page-lembretes .table thead th:nth-child(2),
#page-lembretes .table tbody td:nth-child(2) {
  width: 110px;
  white-space: nowrap;
}
#page-lembretes .table thead th:nth-child(4),
#page-lembretes .table tbody td:nth-child(4) { width: 150px; white-space: nowrap; }
#page-lembretes .table thead th:nth-child(5),
#page-lembretes .table tbody td:nth-child(5) { width: 150px; }
#page-lembretes .table thead th:nth-child(6),
#page-lembretes .table tbody td:nth-child(6) { width: 120px; }
#page-lembretes .table thead th:nth-child(7),
#page-lembretes .table tbody td:nth-child(7) { width: 110px; white-space: nowrap; }
#page-lembretes .table thead th:nth-child(8),
#page-lembretes .table tbody td:nth-child(8) { width: 120px; }
#page-lembretes .table thead th:nth-child(9),
#page-lembretes .table tbody td:nth-child(9) { width: 80px; text-align: center; }
#page-lembretes .table thead th:nth-child(10),
#page-lembretes .table tbody td:nth-child(10) { width: 140px; text-align: center; }

#page-logs-sistema .finance-toolbar {
  margin-top: 8px;
}
#page-logs-sistema .table thead th:nth-child(1),
#page-logs-sistema .table tbody td:nth-child(1) { width: 155px; }
#page-logs-sistema .table thead th:nth-child(2),
#page-logs-sistema .table tbody td:nth-child(2) { width: 84px; }
#page-logs-sistema .table thead th:nth-child(3),
#page-logs-sistema .table tbody td:nth-child(3) { width: 120px; }
#page-logs-sistema .table thead th:nth-child(4),
#page-logs-sistema .table tbody td:nth-child(4) { width: 120px; }
#page-logs-sistema .table thead th:nth-child(6),
#page-logs-sistema .table tbody td:nth-child(6) { width: 110px; }
#page-logs-sistema .table thead th:nth-child(7),
#page-logs-sistema .table tbody td:nth-child(7) { width: 190px; }
#page-logs-sistema .table thead th:nth-child(8),
#page-logs-sistema .table tbody td:nth-child(8) { width: 110px; text-align: center; }

.lg-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 900;
  border: 1px solid transparent;
  white-space: nowrap;
}
.lg-info {
  background: rgba(37, 99, 235, 0.10);
  color: rgba(37, 99, 235, 1);
  border-color: rgba(37, 99, 235, 0.18);
}
.lg-warn {
  background: rgba(245, 158, 11, 0.12);
  color: rgba(180, 83, 9, 1);
  border-color: rgba(245, 158, 11, 0.20);
}
.lg-error {
  background: var(--red-light);
  color: var(--red);
  border-color: rgba(220, 38, 38, 0.22);
}
.lg-ok {
  background: rgba(22, 163, 74, 0.10);
  color: rgba(22, 163, 74, 1);
  border-color: rgba(22, 163, 74, 0.20);
}

#page-controle-mensal .finance-toolbar {
  margin-top: 8px;
}
#page-controle-mensal .cm-lock-card {
  margin-top: 10px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(248,250,252,.95), rgba(255,255,255,.98));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  align-items: center;
}
#page-controle-mensal .cm-lock-title {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}
#page-controle-mensal .cm-lock-sub {
  font-size: 12px;
  color: rgba(51, 65, 85, 0.92);
  margin-top: 2px;
}
#page-controle-mensal .cm-lock-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#page-controle-mensal .cm-lock-note {
  grid-column: 1 / -1;
  font-size: 12px;
  color: rgba(71, 85, 105, 0.95);
}
#page-controle-mensal .cm-grid {
  gap: 14px;
}
#page-controle-mensal .table thead th:nth-child(2),
#page-controle-mensal .table tbody td:nth-child(2),
#page-controle-mensal .table thead th:nth-child(3),
#page-controle-mensal .table tbody td:nth-child(3) {
  width: 110px;
  white-space: nowrap;
}

#page-configuracoes .cfg-grid {
  gap: 14px;
}

#page-configuracoes > .panel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border-color: rgba(226, 232, 240, 0.95);
  background:
    radial-gradient(880px 320px at 0% 0%, rgba(37, 99, 235, 0.10), rgba(255, 255, 255, 0) 60%),
    radial-gradient(880px 320px at 100% 0%, rgba(34, 197, 94, 0.07), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 22px 52px rgba(2, 6, 23, 0.08);
  padding: 16px 16px;
}
#page-configuracoes > .panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-700) 55%, rgba(34, 197, 94, 0.70) 100%);
}
#page-configuracoes > .panel > .panel-head {
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  padding-bottom: 12px;
  margin-bottom: 10px;
}
#page-configuracoes > .panel > .panel-head .panel-title {
  letter-spacing: 0.2px;
  font-weight: 950;
}
#page-configuracoes > .panel > .panel-head .panel-sub {
  color: rgba(71, 85, 105, 0.95);
  font-weight: 700;
}

#page-configuracoes .cfg-grid > .panel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border-color: rgba(226, 232, 240, 0.95);
  background:
    radial-gradient(740px 260px at 0% 0%, rgba(37, 99, 235, 0.07), rgba(255, 255, 255, 0) 60%),
    radial-gradient(740px 260px at 100% 0%, rgba(15, 23, 42, 0.05), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 16px 36px rgba(2, 6, 23, 0.06);
  padding: 14px 14px;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
#page-configuracoes .cfg-grid > .panel:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.40);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 22px 50px rgba(2, 6, 23, 0.09);
}

#page-configuracoes .form-section-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(51, 65, 85, 0.82);
}
#page-configuracoes .badge {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.92);
  font-weight: 900;
}
#page-configuracoes .input {
  border-radius: 12px;
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(248, 250, 252, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}
#page-configuracoes .input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #ffffff;
}

@media (max-width: 980px) {
  #page-controle-mensal .cm-grid { grid-template-columns: 1fr !important; }
  #page-configuracoes .cfg-grid { grid-template-columns: 1fr !important; }
  #page-controle-mensal .cm-lock-card { grid-template-columns: 1fr; }
  #page-controle-mensal .cm-lock-actions { justify-content: flex-start; flex-wrap: wrap; }
}

.lg-meta {
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.6);
  overflow: hidden;
}
.lg-meta-grid {
  display: flex;
  flex-direction: column;
}
.lg-meta-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.lg-meta-row:first-child {
  border-top: 0;
}
.lg-meta-k {
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
}
.lg-meta-v {
  color: rgba(15, 23, 42, 0.86);
}
.lg-meta-text {
  white-space: pre-wrap;
  word-break: break-word;
}
.lg-meta-pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
}
.lg-meta-empty {
  color: rgba(100, 116, 139, 0.92);
  font-weight: 800;
}

.lg-diff {
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.lg-diff-compact {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.lg-diff-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lg-diff-title {
  font-size: 11px;
  font-weight: 900;
  color: rgba(100, 116, 139, 0.92);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lg-diff-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.lg-diff-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(100, 116, 139, 0.9);
}
.lg-diff-mid svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 720px) {
  .lg-meta-row { grid-template-columns: 1fr; }
  .lg-meta-k { white-space: normal; }
  .lg-diff { grid-template-columns: 1fr; }
  .lg-diff-mid { display: none; }
}

#page-relatorio-entregas tr.group-header {
  background: var(--bg-hover);
}
#page-relatorio-entregas .re-group-cell {
  padding: 12px 16px;
  cursor: pointer;
  line-height: 1.2;
}
#page-relatorio-entregas .re-group-label {
  color: rgba(100, 116, 139, 0.92);
  font-weight: 900;
  margin-right: 6px;
}
#page-relatorio-entregas .re-group-num {
  color: #0f172a;
  font-weight: 900;
  margin-right: 6px;
}
#page-relatorio-entregas .re-group-ref {
  color: #2563eb;
  font-weight: 800;
}

#page-relatorio-entregas .re-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}
#page-relatorio-entregas .re-no-prazo {
  background: var(--green-light);
  color: var(--green);
  border-color: rgba(22, 163, 74, 0.18);
}
#page-relatorio-entregas .re-atraso {
  background: var(--red-light);
  color: var(--red);
  border-color: rgba(220, 38, 38, 0.22);
}
#page-relatorio-entregas .re-entregue {
  background: rgba(34, 197, 94, 0.10);
  color: rgba(22, 163, 74, 1);
  border-color: rgba(22, 163, 74, 0.18);
}
#page-relatorio-entregas .re-parcial {
  background: rgba(245, 158, 11, 0.12);
  color: rgba(180, 83, 9, 1);
  border-color: rgba(245, 158, 11, 0.20);
}

.et-grid {
  align-items: start;
}
.et-card-title {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
}
.et-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.et-actions .btn-primary {
  width: 100%;
}
.et-preview-card {
  min-height: 520px;
}
.et-preview-title {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}
.et-preview-stage {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 340px;
}
.et-preview-meta {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(100, 116, 139, 0.95);
  text-align: center;
}
.et-label {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.35);
  border-radius: 10px;
  padding: 14px;
  position: relative;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.08);
}
.et-label-watermark {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 3px solid rgba(148, 163, 184, 0.65);
  transform: rotate(12deg);
}
.et-label-k {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: rgba(15, 23, 42, 0.70);
  margin-bottom: 6px;
}
.et-label-name {
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 6px;
}
.et-label-name-sm { font-size: 12px; }
.et-label-line {
  font-size: 11px;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.88);
  line-height: 1.2;
  margin-top: 2px;
}
.et-label-sep {
  height: 1px;
  background: rgba(15, 23, 42, 0.14);
  margin: 10px 0;
}
.et-label-meta {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 10px;
  font-weight: 800;
  color: rgba(100, 116, 139, 0.95);
}
.et-label-prod {
  padding: 10px;
  display: flex;
  flex-direction: column;
}
.et-prod-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.et-prod-name {
  font-size: 11px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.1;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
}
.et-prod-badge {
  font-size: 10px;
  font-weight: 900;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
  background: rgba(248, 250, 252, 1);
}
.et-prod-mid {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.et-prod-bars {
  width: 110px;
  height: 24px;
  background: repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.92) 3px, transparent 3px, transparent 6px);
  border-radius: 6px;
  opacity: 0.9;
}
.et-prod-price {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
}
@media (max-width: 980px) {
  .panel-grid.et-grid { grid-template-columns: 1fr !important; }
  .et-preview-stage { min-height: 260px; }
}
.panel-sub {
  font-size: 12px;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.58);
  margin-top: 4px;
}
.orc-toolbar {
  margin-top: 10px;
}
.searchbar {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.06);
}
.search-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: #94a3b8;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.searchbar .input {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  font-size: 13px;
}
.searchbar .input:focus {
  box-shadow: none;
}
.quote-table tbody td.td-actions {
  width: 124px;
}
.quote-table {
  table-layout: fixed;
}
.quote-table thead th {
  background: #ffffff;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.9px;
  color: rgba(100, 116, 139, 0.95);
  position: sticky;
  top: 0;
  z-index: 2;
}
.quote-table tbody td {
  padding: 14px 14px;
  border-bottom: 1px solid #eef2f7;
  font-size: 12px;
  font-weight: 400;
  color: #0f172a;
}
.quote-table tbody tr:hover td {
  background: #f8fafc;
}
.quote-table tbody td:nth-child(1) { width: 92px; }
.quote-table tbody td:nth-child(2) { width: auto; }
.quote-table tbody td:nth-child(3) { width: 150px; }
.quote-table tbody td:nth-child(4) { width: 110px; }
.quote-table tbody td:nth-child(5) { width: 110px; }
.quote-table tbody td:nth-child(6) { width: 150px; }
.quote-table tbody td:nth-child(7) { width: 120px; }
#page-orcamentos .quote-table thead th:nth-child(1) { width: 92px; }
#page-orcamentos .quote-table thead th:nth-child(3) { width: 150px; }
#page-orcamentos .quote-table thead th:nth-child(4) { width: 110px; }
#page-orcamentos .quote-table thead th:nth-child(5) { width: 110px; }
#page-orcamentos .quote-table thead th:nth-child(6) { width: 150px; }
#page-orcamentos .quote-table thead th:nth-child(7) { width: 120px; }
.quote-client {
  font-weight: 600;
  color: #0f172a;
}
.quote-ref,
.quote-date,
.quote-validity {
  font-size: 11px;
  font-weight: 600;
  color: rgba(100, 116, 139, 0.95);
}
.quote-validity {
  text-transform: uppercase;
}
.quote-total {
  font-weight: 600;
  color: #0f172a;
}
.quote-table tbody td.td-actions {
  text-align: right;
}
.quote-table .row-actions {
  gap: 12px;
}
.quote-table .row-btn {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 8px;
}
.quote-table .row-btn svg {
  width: 18px;
  height: 18px;
  opacity: 1;
}
.row-btn-view { color: #2563eb; }
.row-btn-edit { color: #f97316; }
.row-btn-delete { color: #ef4444; }
.row-btn-view:hover,
.row-btn-edit:hover,
.row-btn-delete:hover {
  transform: none;
  background: rgba(15, 23, 42, 0.05);
}
.quote-num-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.quote-num-btn:hover {
  text-decoration: underline;
}
#page-orcamentos .table-wrapper {
  max-height: calc(100vh - 340px);
  overflow: auto;
}
#page-orcamentos .row-btn:hover {
  transform: none;
  box-shadow: none;
}
.row-btn-print {
  --btn-accent: 37, 99, 235;
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.07));
}
.row-btn-print:hover {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.16), rgba(37, 99, 235, 0.09));
}
.modal-card[data-variant="orc"] .modal-head {
  padding: 12px 16px;
  background:
    radial-gradient(700px 120px at 0% 0%, rgba(37, 99, 235, 0.10), rgba(37, 99, 235, 0) 55%),
    linear-gradient(180deg, #ffffff, #fbfdff);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}
.modal-card[data-variant="orc"] .modal-title {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}
.modal-card[data-variant="orc"] .modal-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  border: 1px solid rgba(229, 231, 235, 0.9);
  background: #ffffff;
  transition: filter .15s ease, transform .08s ease, box-shadow .15s ease, border-color .15s ease;
}
.modal-card[data-variant="orc"] .modal-close:hover {
  filter: brightness(0.98);
}
.modal-card[data-variant="orc"] .modal-close:active {
  transform: translateY(1px);
}
.modal-card[data-variant="orc"] .modal-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.modal-card[data-variant="orc"] .modal-close::before {
  content: "×";
  font-size: 18px;
  line-height: 1;
  color: rgba(15, 23, 42, 0.72);
}
.modal-card[data-variant="orc"] .modal-body {
  padding: 14px 16px 16px;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0) 60%),
    #f6f8fb;
}
.orc-form {
  display: grid;
  gap: 14px;
}
.orc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}
.orc-main {
  min-width: 0;
  display: grid;
  gap: 14px;
}
.orc-aside {
  align-self: start;
  min-width: 0;
}
.orc-total-panel-sticky {
  position: sticky;
  top: 10px;
}
.orc-meta {
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 14px;
  background:
    radial-gradient(700px 180px at 0% 0%, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0) 55%),
    linear-gradient(180deg, #ffffff, #fbfdff);
  overflow: hidden;
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.06);
  padding: 12px 14px;
  position: static;
}
.orc-meta-title {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 10px;
}
.orc-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.orc-step {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
  color: rgba(15, 23, 42, 0.82);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15px;
  cursor: pointer;
  transition: filter .15s ease, box-shadow .15s ease, transform .08s ease, background-color .15s ease, border-color .15s ease;
}
.orc-step:hover { filter: brightness(0.99); }
.orc-step:active { transform: translateY(1px); }
.orc-step:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.orc-step.is-active {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.10);
  color: #0f172a;
}
.orc-step.is-done {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.10);
  color: rgba(15, 23, 42, 0.88);
}
.orc-step.is-done::before {
  content: "✓";
  margin-right: 6px;
  color: rgba(22, 163, 74, 0.95);
}
.orc-step.is-view {
  border-color: rgba(37, 99, 235, 0.46);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}
.orc-error {
  margin: 0;
}
.orc-section {
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.06);
}
.orc-section.is-view {
  border-color: rgba(37, 99, 235, 0.30);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.08);
}
.orc-section.is-view .orc-section-head {
  background:
    radial-gradient(520px 140px at 0% 0%, rgba(37, 99, 235, 0.10), rgba(37, 99, 235, 0) 62%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255,255,255,0.98));
}
.orc-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255,255,255,0.98));
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  cursor: pointer;
  user-select: none;
  transition: filter .15s ease, background-color .15s ease;
}
.orc-section-head:hover { filter: brightness(0.99); }
.orc-section-head:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.20);
}
.orc-sec-ico {
  width: 14px;
  height: 14px;
  stroke: rgba(37, 99, 235, 0.95);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.orc-sec-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  stroke: rgba(100, 116, 139, 0.95);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}
.orc-section[data-collapsed="1"] .orc-sec-chevron { transform: rotate(-90deg); }
.orc-section[data-collapsed="1"] .orc-section-head { border-bottom: 0; }
.orc-section-body {
  padding: 14px 14px;
  display: grid;
  gap: 12px;
}
.orc-label {
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: rgba(37, 99, 235, 0.92);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.orc-field .input::placeholder {
  color: rgba(100, 116, 139, 0.75);
}
.orc-field .input {
  background: #ffffff;
}
.orc-form .searchbar {
  box-shadow: none;
  padding: 10px 12px;
  cursor: text;
}
.orc-form .searchbar .search-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.orc-form .searchbar .search-toggle:hover { filter: brightness(0.99); }
.orc-form .searchbar .search-toggle:active { transform: translateY(1px); }
.orc-form .searchbar .search-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.orc-form .searchbar .search-ico { pointer-events: none; }
.orc-form .searchbar .search-input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-width .18s ease, opacity .18s ease;
}
.orc-form .searchbar.is-open .search-input {
  max-width: 900px;
  opacity: 1;
  pointer-events: auto;
}
.orc-form .searchbar .input {
  font-size: 13px;
}
.orc-suggest {
  margin-top: 8px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(2, 6, 23, 0.08);
  overflow: auto;
  max-height: 240px;
}
.orc-suggest-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  gap: 10px;
  transition: background-color .15s ease;
}
.orc-suggest-item:hover,
.orc-suggest-item.is-active {
  background: #f1f5f9;
}
.orc-suggest-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.orc-suggest-name {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.orc-suggest-meta {
  font-size: 11px;
  font-weight: 800;
  color: rgba(100, 116, 139, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.orc-grid-1 { display: grid; grid-template-columns: 1fr; gap: 10px; }
.orc-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.orc-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.orc-grid-4 { display: grid; grid-template-columns: 120px minmax(0, 1fr) 160px 120px; gap: 10px; }
.orc-grid-6 { display: grid; grid-template-columns: minmax(0, 1fr) 100px 120px 100px 90px 170px 64px; gap: 10px; align-items: end; }
.orc-mt { margin-top: 10px; }
.orc-add-btn-wrap .btn-primary {
  width: 100%;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  font-weight: 900;
}
.orc-items-table-wrap {
  margin-top: 10px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 12px;
  overflow: auto;
  background: #ffffff;
}
.orc-items-table {
  width: 100%;
  table-layout: fixed;
  min-width: 1080px;
}
.orc-items-table thead th:nth-child(1),
.orc-items-table tbody td:nth-child(1) { width: 130px; }
.orc-items-table thead th:nth-child(3),
.orc-items-table tbody td:nth-child(3) { width: 110px; }
.orc-items-table thead th:nth-child(4),
.orc-items-table tbody td:nth-child(4) { width: 240px; }
.orc-items-table thead th:nth-child(5),
.orc-items-table tbody td:nth-child(5) { width: 260px; }
.orc-items-table thead th:nth-child(6),
.orc-items-table tbody td:nth-child(6) { width: 64px; }
.orc-money-cell { min-width: 0; }
.orc-money-cell input { width: 100%; min-width: 0; }
.orc-items-table .orc_it_qty {
  text-align: right;
}
.orc-items-table .orc_it_price {
  text-align: right;
}
.orc-items-table-wrap.orc-invalid {
  border-color: rgba(239, 68, 68, 0.65);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.10);
}
.orc-items-table thead th {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  font-size: 11px;
  font-weight: 900;
  color: rgba(100, 116, 139, 0.95);
  text-transform: none;
  letter-spacing: 0.2px;
}
.orc-items-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
}
.orc-items-table tbody tr:last-child td {
  border-bottom: 0;
}
.orc-row-new td {
  animation: orc-row-flash .9s ease-out;
}
.orc-row-removing td {
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .14s ease, transform .14s ease;
}
@keyframes orc-row-flash {
  0% { background: rgba(34, 197, 94, 0.18); }
  100% { background: transparent; }
}
.orc-items-table tbody tr:nth-child(2n) td {
  background: rgba(248, 250, 252, 0.60);
}
.orc-items-table tbody tr:hover td {
  background: #f1f5f9;
}
.orc-money-cell { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.orc-money-stack { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; line-height: 1.05; }
.orc-money-old { font-size: 11px; color: rgba(100, 116, 139, 0.9); text-decoration: line-through; }
.orc-money-new { font-size: 12px; font-weight: 800; color: #16a34a; }
.input.input-compact {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: #ffffff;
}
select.input.input-compact,
textarea.input.input-compact {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: #ffffff;
}
.orc-conditions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: start;
}
.orc-total-panel {
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 14px;
  padding: 12px 12px;
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(37, 99, 235, 0.07), rgba(37, 99, 235, 0) 55%),
    linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.06);
}
.orc-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.75);
  padding: 6px 0;
}
.orc-total-row strong {
  color: #0f172a;
  font-weight: 900;
  font-size: 10px;
  min-width: 0;
  max-width: 70%;
  text-align: right;
  white-space: nowrap;
}
.orc-total-row input {
  width: min(220px, 46vw);
  text-align: right;
}
.orc-total-big {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
}
.orc-total-big span {
  font-size: 14px;
  font-weight: 900;
  color: rgba(37, 99, 235, 0.95);
  letter-spacing: 0.4px;
}
.orc-total-big strong {
  font-size: 12px;
  font-weight: 900;
  color: rgba(37, 99, 235, 0.95);
  min-width: 0;
  max-width: 70%;
  text-align: right;
  white-space: nowrap;
}
.orc-notes {
  resize: vertical;
}
.orc-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0 -16px -16px;
  padding: 12px 16px;
  border-top: 1px solid rgba(229, 231, 235, 0.9);
  background:
    radial-gradient(900px 140px at 0% 0%, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0) 60%),
    rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
}
.orc-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.orc-footer-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.72);
}
.orc-footer-total strong {
  font-size: 14px;
  font-weight: 900;
  color: rgba(37, 99, 235, 0.95);
}
.orc-btn-ico {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-right: 8px;
  transform: translateY(2px);
}
@media (max-width: 980px) {
  .orc-layout {
    grid-template-columns: 1fr;
  }
  .orc-meta {
    position: static;
  }
  .orc-total-panel-sticky {
    position: static;
  }
  .orc-grid-4,
  .orc-grid-6,
  .orc-grid-2,
  .orc-grid-3 {
    grid-template-columns: 1fr;
  }
  .orc-conditions {
    grid-template-columns: 1fr;
  }
  .orc-total-row input {
    width: min(220px, 62vw);
  }
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-ok {
  color: #166534;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.22);
}
.badge-warn {
  color: #9a3412;
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.24);
}
.badge-danger {
  color: #991b1b;
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.24);
}

.agcat-modal .agcat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 12px;
  margin: 6px 0;
}
.agcat-modal .agcat-name {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
}
.agcat-modal .agcat-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
}
.quote-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
}
.quote-editor-main,
.quote-editor-side {
  display: grid;
  gap: 12px;
}
.quote-card {
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 14px;
  padding: 12px 12px;
}
.quote-card-title {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.25px;
  margin-bottom: 8px;
}
.quote-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quote-three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.quote-items-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.quote-items-actions .quote-card-title {
  margin: 0;
}
.orc_item_row {
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 12px;
  padding: 10px 10px;
  margin-top: 10px;
  background: #ffffff;
}
.orc_item_grid_top {
  display: grid;
  grid-template-columns: 80px 90px minmax(0, 1fr) 140px 110px;
  gap: 10px;
  align-items: end;
}
.orc_item_grid_bottom {
  display: grid;
  grid-template-columns: 160px 90px 80px 120px 120px 110px;
  gap: 10px;
  align-items: end;
}
.orc_item_spacer {
  height: 10px;
}
.quote-totals {
  display: grid;
  gap: 10px;
}
.quote-total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.78);
}
.quote-total-row strong {
  color: #0f172a;
}
.quote-total-row.big {
  font-size: 14px;
  font-weight: 900;
}
.quote-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}
@media (max-width: 980px) {
  .quote-editor {
    grid-template-columns: 1fr;
  }
  .orc_item_grid_top,
  .orc_item_grid_bottom {
    grid-template-columns: 1fr;
  }
}
.bar-green { background: linear-gradient(180deg, #22c55e, #16a34a); }
.bar-orange { background: linear-gradient(180deg, #fb923c, #ea580c); }

.panel-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.rank-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}
.rank-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
}
.rank-n {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.10);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.82);
}
.rank-name {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-val {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
}
.rank-bar {
  grid-column: 2 / 4;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.20);
  overflow: hidden;
}
.rank-bar > span {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.9), rgba(29, 78, 216, 0.9));
}
.rank-products .rank-bar > span {
  background: linear-gradient(90deg, rgba(29, 78, 216, 0.9), rgba(109, 40, 217, 0.9));
}
.rank-clients .rank-bar > span {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.9), rgba(29, 78, 216, 0.9));
}
.rank-suppliers .rank-bar > span {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.9), rgba(234, 88, 12, 0.9));
}

#page-visao-geral #materiaisAtrasadosList .delivery-demo-hint,
#page-visao-geral #servicosAtrasadosList .delivery-demo-hint {
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(248, 250, 252, 1);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 11px;
  font-weight: 800;
  color: rgba(100, 116, 139, 0.95);
}
#page-visao-geral #materiaisAtrasadosList .delivery-item,
#page-visao-geral #servicosAtrasadosList .delivery-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background:
    radial-gradient(520px 160px at 0% 0%, rgba(15, 23, 42, 0.06), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.08);
  position: relative;
  overflow: hidden;
}
#page-visao-geral #materiaisAtrasadosList .delivery-item:hover,
#page-visao-geral #servicosAtrasadosList .delivery-item:hover {
  box-shadow: 0 22px 48px rgba(2, 6, 23, 0.12);
  border-color: rgba(148, 163, 184, 0.45);
  transform: translateY(-1px);
}
#page-visao-geral #materiaisAtrasadosList .delivery-item::before,
#page-visao-geral #servicosAtrasadosList .delivery-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
}
#page-visao-geral #materiaisAtrasadosList .delivery-item.is-sale::before,
#page-visao-geral #servicosAtrasadosList .delivery-item.is-sale::before {
  background: linear-gradient(180deg, rgba(37, 99, 235, 1), rgba(29, 78, 216, 1));
}
#page-visao-geral #materiaisAtrasadosList .delivery-item.is-buy::before,
#page-visao-geral #servicosAtrasadosList .delivery-item.is-buy::before {
  background: linear-gradient(180deg, rgba(37, 99, 235, 1), rgba(4, 120, 87, 1));
}
#page-visao-geral #materiaisAtrasadosList .delivery-item.is-service::before,
#page-visao-geral #servicosAtrasadosList .delivery-item.is-service::before {
  background: linear-gradient(180deg, rgba(220, 38, 38, 1), rgba(185, 28, 28, 1));
}
#page-visao-geral #materiaisAtrasadosList .delivery-left,
#page-visao-geral #servicosAtrasadosList .delivery-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#page-visao-geral #materiaisAtrasadosList .delivery-title,
#page-visao-geral #servicosAtrasadosList .delivery-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#page-visao-geral #materiaisAtrasadosList .delivery-product,
#page-visao-geral #servicosAtrasadosList .delivery-product {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
}
#page-visao-geral #materiaisAtrasadosList .delivery-sub,
#page-visao-geral #servicosAtrasadosList .delivery-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(100, 116, 139, 0.95);
}
#page-visao-geral #materiaisAtrasadosList .delivery-badge,
#page-visao-geral #servicosAtrasadosList .delivery-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
}
#page-visao-geral #materiaisAtrasadosList .delivery-badge-sale,
#page-visao-geral #servicosAtrasadosList .delivery-badge-sale {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #1d4ed8;
}
#page-visao-geral #materiaisAtrasadosList .delivery-badge-buy,
#page-visao-geral #servicosAtrasadosList .delivery-badge-buy {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #047857;
}
#page-visao-geral #materiaisAtrasadosList .delivery-badge-service,
#page-visao-geral #servicosAtrasadosList .delivery-badge-service {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #b91c1c;
}
#page-visao-geral #materiaisAtrasadosList .delivery-right,
#page-visao-geral #servicosAtrasadosList .delivery-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}
#page-visao-geral #materiaisAtrasadosList .delivery-due,
#page-visao-geral #servicosAtrasadosList .delivery-due {
  font-size: 10.5px;
  font-weight: 900;
  color: rgba(220, 38, 38, 0.98);
}
#page-visao-geral #materiaisAtrasadosList .delivery-actions,
#page-visao-geral #servicosAtrasadosList .delivery-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
#page-visao-geral #materiaisAtrasadosList .delivery-missing,
#page-visao-geral #servicosAtrasadosList .delivery-missing {
  font-size: 10.5px;
  font-weight: 800;
  color: rgba(100, 116, 139, 0.95);
}
#page-visao-geral #materiaisAtrasadosList .delivery-view-btn,
#page-visao-geral #servicosAtrasadosList .delivery-view-btn {
  width: 28px;
  height: 28px;
  border-radius: 11px;
  box-shadow: 0 12px 22px rgba(2, 6, 23, 0.10), inset 0 1px 0 rgba(255,255,255,0.80);
}
#page-visao-geral #materiaisAtrasadosList .delivery-item.is-sale .delivery-view-btn,
#page-visao-geral #servicosAtrasadosList .delivery-item.is-sale .delivery-view-btn {
  --btn-accent: 37, 99, 235;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.72);
  color: #2563eb;
}
#page-visao-geral #materiaisAtrasadosList .delivery-item.is-sale .delivery-view-btn:hover,
#page-visao-geral #servicosAtrasadosList .delivery-item.is-sale .delivery-view-btn:hover {
  background: rgba(255, 255, 255, 0.84);
}
#page-visao-geral #materiaisAtrasadosList .delivery-item.is-buy .delivery-view-btn,
#page-visao-geral #servicosAtrasadosList .delivery-item.is-buy .delivery-view-btn {
  --btn-accent: 37, 99, 235;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.72);
  color: #047857;
}
#page-visao-geral #materiaisAtrasadosList .delivery-item.is-buy .delivery-view-btn:hover,
#page-visao-geral #servicosAtrasadosList .delivery-item.is-buy .delivery-view-btn:hover {
  background: rgba(255, 255, 255, 0.84);
}
#page-visao-geral #materiaisAtrasadosList .delivery-item.is-service .delivery-view-btn,
#page-visao-geral #servicosAtrasadosList .delivery-item.is-service .delivery-view-btn {
  --btn-accent: 220, 38, 38;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.72);
  color: #b91c1c;
}
#page-visao-geral #materiaisAtrasadosList .delivery-item.is-service .delivery-view-btn:hover,
#page-visao-geral #servicosAtrasadosList .delivery-item.is-service .delivery-view-btn:hover {
  background: rgba(255, 255, 255, 0.84);
}
@media (max-width: 820px) {
  #page-visao-geral #materiaisAtrasadosList .delivery-item,
  #page-visao-geral #servicosAtrasadosList .delivery-item {
    flex-direction: column;
    align-items: stretch;
  }
  #page-visao-geral #materiaisAtrasadosList .delivery-right {
    text-align: left;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  #page-visao-geral #materiaisAtrasadosList .delivery-actions {
    justify-content: flex-end;
  }
}
.list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
}
.list-row strong {
  color: #0f172a;
  font-weight: 800;
}
.generic-text {
  margin-top: 10px;
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 250px 1fr;
  }
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .finance-chart {
    grid-template-columns: 40px 1fr;
    gap: 8px;
  }
  .month-pair {
    gap: 10px;
  }
  .chart-bar {
    width: 52px;
  }
  .panel-grid {
    grid-template-columns: 1fr;
  }
  .alert-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .alert-row {
    grid-template-columns: 1fr;
  }
  .finance-chart {
    grid-template-columns: 34px 1fr;
  }
  .finance-bars {
    gap: 10px;
  }
  .chart-bar {
    width: 40px;
    border-radius: 10px 10px 4px 4px;
  }
  .month-label { font-size: 10px; }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  width: 560px;
  max-width: calc(100vw - 36px);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
}
.modal-card[data-size="lg"] {
  width: 860px;
}
.modal-card[data-size="xl"] {
  width: 1120px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  border-bottom: 1px solid #e5e7eb;
}
.modal-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.2px;
}
.modal-close {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
  transition: filter .15s ease, transform .08s ease, box-shadow .15s ease;
}
.modal-close:hover {
  filter: brightness(0.98);
}
.modal-close:active {
  transform: translateY(1px);
}
.modal-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.modal-body {
  padding: 14px 14px 16px;
  color: #0f172a;
  overflow: auto;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 14px 14px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}
.modal-actions[hidden] {
  display: none;
}
.modal-card[data-variant="pdf"] .modal-body {
  padding: 0;
}

.modal-card[data-variant="po"] {
  width: min(1280px, calc(100vw - 36px));
}

.po-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.po-items-table {
  width: 100%;
  min-width: 980px;
}

.po-items-table th,
.po-items-table td {
  white-space: nowrap;
}

.po-items-table td:nth-child(1) {
  white-space: normal;
}
.pdf-viewer {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  min-height: 520px;
}
.pdf-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}
.pdf-frame {
  width: 100%;
  flex: 1 1 auto;
  border: 0;
  background: #ffffff;
}

.orc-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  pointer-events: none;
}
.orc-view-wrap {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 260px;
  top: 60px;
  background: #6b7280;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}
body.orc-view-open {
  overflow: hidden;
}
.orc-view-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}
.orc-view-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.orc-view-date {
  font-size: 12px;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.70);
  padding-right: 4px;
}
.orc-view-title {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}
.orc-view-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2px;
  border: 1px solid rgba(37, 99, 235, 0.30);
  background: rgba(37, 99, 235, 0.10);
  color: #0f172a;
}
.orc-view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.orc-view-icon-btn {
  width: 36px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.90);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: filter .15s ease, transform .08s ease, box-shadow .15s ease, border-color .15s ease;
}
.orc-view-icon-btn:hover { filter: brightness(0.98); }
.orc-view-icon-btn:active { transform: translateY(1px); }
.orc-view-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}
.orc-view-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: rgba(15, 23, 42, 0.75);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.orc-view-actions .btn-secondary.active {
  border-color: rgba(37, 99, 235, 0.30);
  background: rgba(37, 99, 235, 0.10);
}
.orc-view-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px;
  scrollbar-color: rgba(255, 255, 255, 0.55) rgba(15, 23, 42, 0.18);
  scrollbar-width: thin;
}
.orc-view-body::-webkit-scrollbar {
  width: 10px;
}
.orc-view-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.16);
}
.orc-view-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.16);
}
.orc-view-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.55);
}
.orc-view-paper {
  max-width: 1020px;
  margin: 0 auto;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  min-height: 0;
}
.orc-view-iframe {
  width: 100%;
  height: 1px;
  min-height: 0;
  border: 0;
  background: #ffffff;
  display: block;
}
@media (max-width: 720px) {
  .orc-view-wrap {
    left: 0;
    top: 0;
  }
  .orc-view-title {
    display: none;
  }
  .orc-view-paper {
    min-height: 0;
  }
  .orc-view-iframe {
    height: 1px;
    min-height: 0;
  }
}

.po-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  pointer-events: none;
}
.po-view-wrap {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 260px;
  top: 60px;
  background: #6b7280;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}
body.po-view-open {
  overflow: hidden;
}
.po-view-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}
.po-view-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.po-view-date {
  font-size: 12px;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.70);
  padding-right: 4px;
}
.po-view-title {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}
.po-view-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2px;
  border: 1px solid rgba(37, 99, 235, 0.30);
  background: rgba(37, 99, 235, 0.10);
  color: #0f172a;
}
.po-view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.po-view-icon-btn {
  width: 36px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.90);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: filter .15s ease, transform .08s ease, box-shadow .15s ease, border-color .15s ease;
}
.po-view-icon-btn:hover { filter: brightness(0.98); }
.po-view-icon-btn:active { transform: translateY(1px); }
.po-view-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}
.po-view-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: rgba(15, 23, 42, 0.75);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.po-view-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px;
  scrollbar-color: rgba(255, 255, 255, 0.55) rgba(15, 23, 42, 0.18);
  scrollbar-width: thin;
}
.po-view-body::-webkit-scrollbar {
  width: 10px;
}
.po-view-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.16);
}
.po-view-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.16);
}
.po-view-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.55);
}
.po-view-paper {
  max-width: 1020px;
  margin: 0 auto;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  min-height: 0;
}
.po-view-iframe {
  width: 100%;
  height: 1px;
  min-height: 0;
  border: 0;
  background: #ffffff;
  display: block;
}
@media (max-width: 720px) {
  .po-view-wrap {
    left: 0;
    top: 0;
  }
  .po-view-title {
    display: none;
  }
  .po-view-paper {
    min-height: 0;
  }
  .po-view-iframe {
    height: 1px;
    min-height: 0;
  }
}
.modal-text {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}
.modal-hint {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.modal-kpi {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}
.modal-kpi span {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.modal-kpi strong {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}
.tooltip {
  position: fixed;
  z-index: 90;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.92);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.35);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  transform: translateZ(0);
  max-width: 280px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
