/* Mantiqueira Smart visual system */
:root {
  --ink: #20231f;
  --muted: #73776f;
  --paper: #f2f0eb;
  --card: #fffdf9;
  --line: #dedbd3;
  --orange: #df522d;
  --orange-dark: #b83d21;
  --side: #20231f;
  --side-soft: #2b302a;
  --success: #4d9061;
  --warning: #b57c22;
  --danger: #bf4c3a;
  --shadow-sm: 0 1px 2px rgba(28, 31, 27, .05), 0 5px 16px rgba(28, 31, 27, .04);
  --shadow-md: 0 10px 30px rgba(28, 31, 27, .09);
  --radius: 10px;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 90% -10%, rgba(223, 82, 45, .08), transparent 30rem),
    var(--paper);
  color: var(--ink);
  letter-spacing: -.01em;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  font-weight: 600;
}

.sidebar {
  width: 258px;
  padding: 24px 15px 18px;
  background: linear-gradient(180deg, #222620 0%, #1c1f1b 100%);
  box-shadow: 10px 0 32px rgba(18, 20, 17, .08);
}

.brand {
  margin: 0 12px 28px;
  gap: 11px;
  letter-spacing: 2.4px;
}

.brand-mark {
  width: 39px;
  height: 39px;
  background: linear-gradient(145deg, #f16a42, var(--orange));
  box-shadow: 0 5px 16px rgba(223, 82, 45, .28);
}

.brand-mark img {
  transform: rotate(18deg);
}

.brand-row .brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-row .brand-mark img {
  width: 80%;
  height: 80%;
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  transform: rotate(18deg) !important;
}

.brand small {
  color: #a0a79d;
  font-size: 10px;
  letter-spacing: 2px;
}

.workspace {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  padding: 11px 12px;
  margin: 0 2px 25px;
}

.workspace-dot {
  box-shadow: 0 0 0 4px rgba(115, 187, 122, .12);
}

.side-nav {
  gap: 5px;
}

.side-nav p {
  margin: 19px 13px 7px;
  color: #7c8479;
  letter-spacing: 1.5px;
}

.side-nav a {
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 13px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.side-nav a:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, .065);
}

.side-nav a.active {
  background: linear-gradient(90deg, rgba(223, 82, 45, .22), rgba(223, 82, 45, .06));
  box-shadow: inset 3px 0 var(--orange);
}

.side-nav a i.alert {
  box-shadow: 0 2px 8px rgba(223, 82, 45, .25);
}

.sidebar-foot {
  padding: 16px 9px 0;
  border-top-color: rgba(255, 255, 255, .1);
}

.avatar {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}

.app-shell {
  margin-left: 258px;
}

.app-header {
  height: 78px;
  padding: 0 4.8%;
  gap: 24px;
  background: rgba(250, 249, 246, .9);
  border-bottom-color: rgba(222, 219, 211, .82);
  backdrop-filter: blur(14px);
}

.breadcrumb {
  gap: 10px;
}

.breadcrumb span {
  color: var(--orange);
  font-weight: 500;
  letter-spacing: 1px;
}

.breadcrumb strong {
  font-size: 13px;
}

.global-search {
  height: 42px;
  max-width: 520px;
  border-color: var(--line);
  border-radius: 9px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .02);
}

.global-search:focus-within {
  border-color: rgba(223, 82, 45, .7);
  box-shadow: 0 0 0 3px rgba(223, 82, 45, .1);
}

.global-search input::placeholder {
  color: #a1a39d;
}

.global-search kbd {
  border-radius: 5px;
  background: #f5f2ec;
}

.header-right {
  gap: 9px;
  align-items: center;
}

.header-icon,
.mobile-menu {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
}

.header-icon:hover,
.mobile-menu:hover {
  border-color: var(--line);
  background: var(--card);
  color: var(--orange);
}

.main-content {
  max-width: 1560px;
  padding: 42px 4.8% 72px;
}

.view-heading {
  margin-bottom: 28px;
}

.eyebrow {
  font-weight: 500;
  letter-spacing: 1.7px;
}

.view-heading h1 {
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -.055em;
  line-height: 1.05;
}

.view-heading p:not(.eyebrow) {
  max-width: 680px;
  line-height: 1.6;
}

.date {
  color: #8c9088;
  letter-spacing: .3px;
}

.stats-grid {
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card,
.panel,
.warehouse-card,
.module-card,
.battery-overview-card,
.piece-card,
.sent-budget-card,
.reducer-card {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-card {
  position: relative;
  min-height: 148px;
  overflow: hidden;
  padding: 21px;
  background: linear-gradient(145deg, var(--card), #fbf8f2);
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--orange);
  opacity: .85;
}

.stat-card:nth-child(2)::before { background: var(--success); }
.stat-card:nth-child(3)::before { background: #a27a45; }
.stat-card:nth-child(4)::before { background: #6689b8; }

.stat-card label {
  color: #767b73;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.stat-card strong {
  margin: 15px 0 9px;
  font-size: 31px;
  letter-spacing: -.055em;
}

.stat-card small {
  font-size: 9px;
}

.stat-icon {
  opacity: .9;
  font-size: 22px;
}

.panel {
  padding: 24px;
  background: rgba(255, 253, 249, .88);
}

.panel-title {
  margin-bottom: 18px;
}

.panel-title h2 {
  font-size: 15px;
  letter-spacing: -.025em;
}

.activity {
  min-height: 57px;
  border-top-color: #ebe8e1;
}

.activity-mark {
  flex-shrink: 0;
  border-radius: 9px;
  background: #f9e9e2;
}

.activity strong {
  line-height: 1.35;
}

.activity small {
  line-height: 1.4;
}

.module-grid {
  gap: 12px;
}

.module-card {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.module-card:hover,
.warehouse-card:hover,
.battery-overview-card:hover,
.piece-card:hover,
.reducer-card:hover {
  border-color: rgba(223, 82, 45, .55);
  box-shadow: var(--shadow-md);
}

.product-card,
.warehouse-card,
.module-card {
  overflow: hidden;
}

.warehouse-card {
  background: var(--card);
}

.warehouse-card .warehouse-number {
  font-weight: 500;
}

.toolbar,
.reducer-filter-panel,
.piece-toolbar {
  border-radius: 10px;
}

.reducer-filter-panel {
  background: #ebe8e0;
  border-color: #d9d4c9;
}

select,
input,
textarea {
  border-radius: 7px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(223, 82, 45, .72) !important;
  box-shadow: 0 0 0 3px rgba(223, 82, 45, .1);
}

button:not(.header-icon):not(.mobile-menu):not(.modal-close):not(.request-remove):not(.save):not(.exp-point):not(.qtybtn) {
  border-radius: 7px;
}

.inline-form button,
.config-save,
.login-form button,
.part-form button,
.report-box button {
  background: linear-gradient(135deg, #ed6840, var(--orange));
  box-shadow: 0 5px 12px rgba(223, 82, 45, .18);
}

.inline-form button:hover,
.config-save:hover,
.login-form button:hover,
.part-form button:hover,
.report-box button:hover {
  background: linear-gradient(135deg, #f0784f, var(--orange-dark));
  transform: translateY(-1px);
}

.filter-chip {
  border-radius: 999px;
}

.filter-chip.on {
  box-shadow: 0 4px 10px rgba(223, 82, 45, .17);
}

.reducer-card {
  padding: 17px;
  background: linear-gradient(155deg, var(--card), #fbf8f3);
}

.reducer-card h3 {
  letter-spacing: -.035em;
}

.reducer-card .reducer-thumb {
  border-radius: 9px;
  border-color: #d8d6cf;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}

.reducer-card-actions .edit-technical,
.piece-edit-btn {
  border-radius: 7px;
}

.modal-backdrop {
  background: rgba(28, 31, 27, .62);
  backdrop-filter: blur(5px);
}

.modal {
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 14px;
  padding: 30px;
  box-shadow: 0 24px 70px rgba(20, 22, 19, .25);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.modal-close:hover {
  background: #f7e8e1;
  color: var(--orange);
}

.toast {
  right: 28px;
  bottom: 26px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 9px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}

.login-wrap {
  position: relative;
  min-height: calc(100vh - 150px);
}

.login-wrap::before {
  content: 'OPERATION CONTROL';
  position: absolute;
  top: 15%;
  left: 50%;
  color: rgba(32, 35, 31, .055);
  font: 800 clamp(32px, 7vw, 90px) Manrope, sans-serif;
  letter-spacing: -.08em;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  border-radius: 16px;
  border-color: var(--line);
  box-shadow: 0 24px 60px rgba(30, 33, 29, .12);
}

.login-card h1 {
  letter-spacing: .08em;
}

.login-form input {
  border-radius: 8px;
}

.login-form.is-submitting {
  animation: loginPulse 1.8s ease-in-out infinite;
}

.login-form.is-submitting button {
  cursor: wait;
  opacity: .88;
}

.login-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -2px;
  animation: loginSpin .7s linear infinite;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

@keyframes loginPulse {
  50% { opacity: .84; }
}

.splash {
  background: radial-gradient(circle at 50% 35%, #30372e 0%, #1b1f1b 64%);
}

.splash-track {
  border-radius: 999px;
}

.splash-bar {
  background: linear-gradient(90deg, #f17a52, var(--orange));
}

.sync-indicator {
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(28, 31, 27, .04);
}

/* Dark theme */
:root[data-theme='dark'] {
  --ink: #f0eee8;
  --muted: #a3a69e;
  --paper: #121513;
  --card: #1d211e;
  --line: #343a34;
  --orange: #ef7952;
  --orange-dark: #d45b38;
  --side: #10130f;
  --side-soft: #202620;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2), 0 7px 20px rgba(0, 0, 0, .12);
}

:root[data-theme='dark'] body {
  background: radial-gradient(circle at 90% -10%, rgba(239, 121, 82, .11), transparent 30rem), var(--paper);
}

:root[data-theme='dark'] .app-header {
  background: rgba(24, 28, 24, .88);
  border-bottom-color: rgba(255, 255, 255, .08);
}

:root[data-theme='dark'] .stat-card,
:root[data-theme='dark'] .panel,
:root[data-theme='dark'] .reducer-card {
  background: linear-gradient(145deg, var(--card), #1a1e1b);
}

:root[data-theme='dark'] .reducer-filter-panel {
  background: #1a1f1b;
  border-color: var(--line);
}

:root[data-theme='dark'] .global-search,
:root[data-theme='dark'] .global-search kbd {
  background: #222722;
  border-color: var(--line);
}

:root[data-theme='dark'] .login-wrap::before {
  color: rgba(255, 255, 255, .035);
}

:root[data-theme='dark'] .modal-close:hover {
  background: #30231d;
}

@media (max-width: 950px) {
  .sidebar { width: 226px; }
  .app-shell { margin-left: 226px; }
  .main-content { padding-inline: 3.5%; }
}

@media (max-width: 700px) {
  .sidebar { width: 270px; }
  .app-shell { margin-left: 0; }
  .app-header {
    height: 66px;
    padding: 0 16px;
    gap: 10px;
  }
  .global-search { height: 38px; }
  .main-content { padding: 28px 16px 54px; }
  .view-heading h1 { font-size: 29px; }
  .view-heading { margin-bottom: 24px; }
  .stats-grid { gap: 9px; }
  .stat-card { min-height: 128px; padding: 15px; }
  .stat-card strong { margin-top: 12px; font-size: 24px; }
  .stat-card small { font-size: 8px; }
  .panel { padding: 17px 15px; }
  .panel-title { gap: 9px; }
  .reducer-card { padding: 12px; }
  .reducer-card .reducer-thumb { height: 125px; }
  .login-wrap::before { top: 10%; font-size: 29px; }
  .login-card { padding: 32px 22px; }
  .modal { padding: 25px 18px; border-radius: 12px; }
  .toast { right: 14px; bottom: 16px; left: 14px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Navigation and operational polish */
.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-row .brand {
  flex: 1;
  min-width: 0;
}

.sidebar-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: #b7bdb5;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.sidebar-toggle:hover {
  background: rgba(223, 82, 45, .2);
  color: #fff;
}

.sidebar-toggle svg {
  transition: transform .2s ease;
}

.sidebar-collapsed .sidebar {
  width: 82px;
  padding-inline: 12px;
}

.sidebar-collapsed .app-shell {
  margin-left: 82px;
}

.sidebar-collapsed .brand-row .brand {
  justify-content: center;
  margin-inline: 0;
}

.sidebar-collapsed .brand-row .brand > span:last-child,
.sidebar-collapsed .workspace > span:not(.workspace-dot),
.sidebar-collapsed .workspace b,
.sidebar-collapsed .side-nav p,
.sidebar-collapsed .sidebar-foot > div:not(.avatar),
.sidebar-collapsed .sidebar-foot button {
  display: none;
}

.sidebar-collapsed .brand-row .brand-mark {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
}

.sidebar-collapsed .workspace {
  justify-content: center;
  padding: 13px 0;
}

.sidebar-collapsed .side-nav a {
  justify-content: center;
  padding-inline: 0;
  font-size: 0;
}

.sidebar-collapsed .side-nav a span {
  width: auto;
}

.sidebar-collapsed .side-nav a i {
  display: none;
}

.sidebar-collapsed .sidebar-foot {
  justify-content: center;
  padding-inline: 0;
}

.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

@media (min-width: 701px) {
  .sidebar-collapsed .sidebar:hover {
    width: 258px;
    padding-inline: 15px;
  }

  body.sidebar-collapsed:has(.sidebar:hover) .app-shell {
    margin-left: 258px;
  }

  .sidebar-collapsed .sidebar:hover .brand-row .brand {
    justify-content: flex-start;
    margin: 0 12px 28px;
  }

  .sidebar-collapsed .sidebar:hover .brand-row .brand > span:last-child,
  .sidebar-collapsed .sidebar:hover .workspace > span:not(.workspace-dot),
  .sidebar-collapsed .sidebar:hover .workspace b,
  .sidebar-collapsed .sidebar:hover .side-nav p,
  .sidebar-collapsed .sidebar:hover .sidebar-foot > div:not(.avatar),
  .sidebar-collapsed .sidebar:hover .sidebar-foot button {
    display: block;
  }

  .sidebar-collapsed .sidebar:hover .workspace {
    justify-content: flex-start;
    padding: 11px 12px;
  }

  .sidebar-collapsed .sidebar:hover .side-nav a {
    justify-content: flex-start;
    padding-inline: 13px;
    font-size: 12px;
  }

  .sidebar-collapsed .sidebar:hover .side-nav a span {
    width: 17px;
  }

  .sidebar-collapsed .sidebar:hover .side-nav a i {
    display: inline-block;
  }

  .sidebar-collapsed .sidebar:hover .sidebar-foot {
    justify-content: flex-start;
    padding-inline: 9px;
  }

  .sidebar-collapsed .sidebar:hover .sidebar-toggle svg {
    transform: none;
  }
}

.mobile-bottom-nav {
  display: none;
}

.main-content:has(.dashboard-grid)::before {
  content: 'CENTRO DE OPERACOES  /  DADOS ATUALIZADOS EM TEMPO REAL';
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--success);
  font: 500 9px 'DM Mono';
  letter-spacing: 1.1px;
}

.main-content:has(.dashboard-grid)::after {
  content: '';
  display: block;
  position: absolute;
  width: 7px;
  height: 7px;
  margin-top: -29px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(77, 144, 97, .12);
}

.request-status,
.warehouse-status,
.app-status,
.sent-budget-channel,
.part-stock,
.reducer-status {
  border-radius: 999px !important;
  font-weight: 600;
  letter-spacing: .2px;
}

.request-status,
.warehouse-status,
.app-status {
  border: 1px solid transparent;
}

.reducer-status {
  padding: 4px 8px;
  background: #edf5ed;
}

.reducer-status.available {
  background: #fbf3dc;
}

.dashboard-grid > .panel:first-child,
.dashboard-grid > .panel:last-child {
  position: relative;
}

.dashboard-grid > .panel:first-child::before,
.dashboard-grid > .panel:last-child::before {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 3px;
  border-radius: 3px;
  background: var(--orange);
  opacity: .75;
}

.dashboard-grid > .panel:last-child::before {
  background: #6689b8;
}

.dashboard-grid > .panel .panel-title,
.dashboard-grid > .panel .activity,
.dashboard-grid > .panel .module-grid {
  position: relative;
  z-index: 1;
}

@media (max-width: 950px) {
  .sidebar-collapsed .sidebar { width: 82px; }
  .sidebar-collapsed .app-shell { margin-left: 82px; }
}

@media (max-width: 700px) {
  .sidebar-toggle { display: none; }
  .sidebar-collapsed .sidebar,
  .sidebar-collapsed .app-shell { width: auto; margin-left: 0; }
  .mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 8;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: rgba(31, 35, 31, .94);
    box-shadow: 0 12px 30px rgba(18, 20, 17, .24);
    backdrop-filter: blur(14px);
  }

  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 3px 7px;
    border-radius: 11px;
    color: #aeb4aa;
    text-decoration: none;
    transition: background .18s ease, color .18s ease;
  }

  .mobile-bottom-nav a.active {
    background: rgba(223, 82, 45, .2);
    color: #fff;
  }

  .mobile-bottom-nav a.active svg {
    color: var(--orange);
  }

  .mobile-bottom-nav small {
    font-size: 8px;
    letter-spacing: .1px;
  }

  .main-content {
    padding-bottom: 112px;
  }

  .main-content:has(.dashboard-grid)::before {
    margin-bottom: 14px;
    font-size: 8px;
    letter-spacing: .7px;
  }

  .main-content:has(.dashboard-grid)::after {
    margin-top: -25px;
  }

  .dashboard-grid > .panel:first-child::before,
  .dashboard-grid > .panel:last-child::before {
    top: 16px;
    bottom: 16px;
  }
}

:root[data-theme='dark'] .reducer-status {
  background: #1c2a1e;
  color: #7fd08a;
}

:root[data-theme='dark'] .reducer-status.available {
  background: #2b2418;
  color: #d8a35c;
}

/* Dashboard: cleaner command-center layout */
.main-content:has(.dashboard-grid) {
  max-width: 1600px;
}

.main-content:has(.dashboard-grid) .view-heading {
  position: relative;
  min-height: 154px;
  align-items: center;
  margin: 0 0 18px;
  padding: 28px 32px;
  overflow: hidden;
  border: 1px solid rgba(222, 219, 211, .9);
  border-radius: 16px;
  background:
    radial-gradient(circle at 86% 50%, rgba(223, 82, 45, .16), transparent 13rem),
    linear-gradient(110deg, #fffdf9 0%, #f7f3ec 100%);
  box-shadow: var(--shadow-sm);
}

.main-content:has(.dashboard-grid) .view-heading::after {
  content: '';
  position: absolute;
  right: 46px;
  top: -80px;
  width: 235px;
  height: 235px;
  border: 1px solid rgba(223, 82, 45, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 20px rgba(223, 82, 45, .035), 0 0 0 42px rgba(223, 82, 45, .025);
  pointer-events: none;
}

.main-content:has(.dashboard-grid) .view-heading > div,
.main-content:has(.dashboard-grid) .view-heading > .date {
  position: relative;
  z-index: 1;
}

.main-content:has(.dashboard-grid) .view-heading h1 {
  font-size: clamp(27px, 3.2vw, 42px);
}

.main-content:has(.dashboard-grid) .view-heading p:not(.eyebrow) {
  max-width: 560px;
  margin-top: 11px;
}

.main-content:has(.dashboard-grid) .view-heading > .date {
  align-self: flex-start;
  padding: 7px 10px;
  border: 1px solid rgba(77, 144, 97, .2);
  border-radius: 999px;
  background: rgba(237, 245, 237, .75);
  color: var(--success);
}

.main-content:has(.dashboard-grid) .stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
  align-items: stretch;
}

.main-content:has(.dashboard-grid) .stat-card {
  isolation: isolate;
  min-height: 138px;
  padding: 20px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--card) 0%, #faf7f1 100%);
  box-shadow: 0 8px 18px rgba(28, 31, 27, .06), 0 20px 42px rgba(28, 31, 27, .045), inset 0 1px 0 rgba(255, 255, 255, .75);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.main-content:has(.dashboard-grid) .stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(223, 82, 45, .45);
  box-shadow: 0 12px 22px rgba(28, 31, 27, .1), 0 24px 46px rgba(223, 82, 45, .1), inset 0 1px 0 rgba(255, 255, 255, .85);
}

.main-content:has(.dashboard-grid) .stat-card strong {
  margin: 12px 0 5px;
  font-size: 29px;
}

.main-content:has(.dashboard-grid) .stat-card .stat-icon {
  display: grid;
  float: right;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(223, 82, 45, .16);
  border-radius: 11px;
  background: rgba(223, 82, 45, .08);
  box-shadow: 0 0 0 5px rgba(223, 82, 45, .035), 0 6px 14px rgba(223, 82, 45, .1);
}

.main-content:has(.dashboard-grid) .stat-card:nth-child(2) .stat-icon {
  border-color: rgba(77, 144, 97, .18);
  background: rgba(77, 144, 97, .09);
  box-shadow: 0 0 0 5px rgba(77, 144, 97, .035), 0 6px 14px rgba(77, 144, 97, .1);
}

.main-content:has(.dashboard-grid) .stat-card:nth-child(3) .stat-icon {
  border-color: rgba(162, 122, 69, .18);
  background: rgba(162, 122, 69, .09);
  box-shadow: 0 0 0 5px rgba(162, 122, 69, .035), 0 6px 14px rgba(162, 122, 69, .1);
}

.main-content:has(.dashboard-grid) .stat-card:nth-child(4) .stat-icon {
  border-color: rgba(102, 137, 184, .18);
  background: rgba(102, 137, 184, .09);
  box-shadow: 0 0 0 5px rgba(102, 137, 184, .035), 0 6px 14px rgba(102, 137, 184, .1);
}

.main-content:has(.dashboard-grid) .stat-card::after {
  right: -28px;
  bottom: -42px;
  width: 105px;
  height: 105px;
  border-width: 2px;
  opacity: .2;
  animation: dashboardOrbit 8s linear infinite;
}

.main-content:has(.dashboard-grid) .stat-card:nth-child(2)::after {
  animation-delay: -2s;
}

.main-content:has(.dashboard-grid) .stat-card:nth-child(3)::after {
  animation-delay: -4s;
}

.main-content:has(.dashboard-grid) .stat-card:nth-child(4)::after {
  animation-delay: -6s;
}

@keyframes dashboardOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.main-content:has(.dashboard-grid) > .panel {
  border-radius: 13px;
}

.main-content:has(.dashboard-grid) > .panel.dashboard-alerts {
  border-color: #ead6ce;
  background: linear-gradient(110deg, #fffaf6, #fffdf9);
}

.main-content:has(.dashboard-grid) .dashboard-grid {
  gap: 16px;
}

.main-content:has(.dashboard-grid) .dashboard-grid > .panel {
  padding: 22px;
}

.main-content:has(.dashboard-grid) .dashboard-grid > .panel:last-child {
  background: linear-gradient(145deg, #fffdf9, #f5f8fb);
}

.main-content:has(.dashboard-grid) .module-card {
  position: relative;
  min-height: 116px !important;
  border-radius: 11px;
  padding: 16px !important;
  background: rgba(255, 255, 255, .7);
}

.main-content:has(.dashboard-grid) .module-card::after {
  content: '\2197';
  position: absolute;
  right: 13px;
  bottom: 11px;
  color: var(--orange);
  font-size: 17px;
  opacity: .75;
}

.main-content:has(.dashboard-grid) .module-card h3 {
  font-size: 13px;
}

@media (max-width: 900px) {
  .main-content:has(.dashboard-grid) .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .main-content:has(.dashboard-grid) .view-heading {
    display: block;
    min-height: 0;
    padding: 22px 18px;
    border-radius: 13px;
  }

  .main-content:has(.dashboard-grid) .view-heading::after {
    right: -70px;
    top: -60px;
    width: 190px;
    height: 190px;
  }

  .main-content:has(.dashboard-grid) .view-heading > .date {
    display: inline-flex;
    margin-top: 17px;
  }

  .main-content:has(.dashboard-grid) .stats-grid {
    gap: 10px;
    margin-bottom: 18px;
  }

  .main-content:has(.dashboard-grid) .stat-card {
    min-height: 124px;
    padding: 15px;
  }

  .main-content:has(.dashboard-grid) .stat-card strong {
    font-size: 23px;
  }

  .main-content:has(.dashboard-grid) .dashboard-grid > .panel {
    padding: 19px 15px;
  }
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .view-heading {
  border-color: var(--line);
  background:
    radial-gradient(circle at 86% 50%, rgba(239, 121, 82, .15), transparent 13rem),
    linear-gradient(110deg, #1d211e 0%, #181c19 100%);
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .stat-card {
  background: linear-gradient(145deg, var(--card) 0%, #181c19 100%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18), 0 20px 42px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .035);
}

/* Operational alerts use readable tiles instead of tiny list rows. */
.main-content:has(.dashboard-grid) .dashboard-alerts {
  padding: 21px;
  border-left: 3px solid var(--orange);
  background: linear-gradient(110deg, #F4F0EB, #E6E6E6);
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-item {
  display: flex;
  align-items: center;
  min-height: 88px;
  gap: 11px;
  padding: 14px 13px !important;
  border: 1px solid #CFCBC4;
  border-left: 3px solid var(--orange);
  border-radius: 11px;
  background: #E6E6E6;
  box-shadow: 0 4px 12px rgba(62, 62, 62, .06);
  transform: none;
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-item:hover {
  transform: translateY(-2px);
  border-color: var(--orange);
  box-shadow: 0 9px 18px rgba(62, 62, 62, .11);
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-item .activity-mark {
  display: grid;
  flex: 0 0 36px;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #F8E4DD;
  color: #B34E38;
  font-size: 16px;
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-item strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-warning {
  border-left-color: #D29A38;
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-warning .activity-mark {
  background: #FBF3DC;
  color: #9A7310;
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-info {
  border-left-color: #4D9061;
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-info .activity-mark {
  background: #E7F1E9;
  color: #3F8053;
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-item > b {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--orange);
  font-size: 16px;
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-actions {
  gap: 8px;
  margin-top: 14px;
}

.main-content:has(.dashboard-grid) .dashboard-alerts .alert-actions a {
  border-radius: 8px;
  background: #D3D3D3;
  font-size: 9px;
}

@media (max-width: 900px) {
  .main-content:has(.dashboard-grid) .dashboard-alerts .alert-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .main-content:has(.dashboard-grid) .dashboard-alerts {
    padding: 17px 15px;
  }

  .main-content:has(.dashboard-grid) .dashboard-alerts .alert-list {
    grid-template-columns: 1fr;
  }
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .dashboard-alerts {
  background: linear-gradient(110deg, #1B1B1B, #141414);
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .dashboard-alerts .alert-item {
  border-color: #383838;
  background: #1B1B1B;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .dashboard-alerts .alert-item:hover {
  border-color: var(--orange);
  box-shadow: 0 9px 18px rgba(0, 0, 0, .3);
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .dashboard-alerts .alert-actions a {
  background: #383838;
}

@media (max-width: 700px) {
  /* Reducer cards become a focused mobile summary. */
  .reducer-card {
    gap: 0;
    padding: 12px;
  }

  .reducer-card .reducer-card-top {
    margin-bottom: 9px;
  }

  .reducer-card .reducer-gear,
  .reducer-card .reducer-card-identity small,
  .reducer-card .reducer-qbadge,
  .reducer-card > p,
  .reducer-card .technical-grid,
  .reducer-card .reducer-card-foot,
  .reducer-card .reducer-card-specs {
    display: none !important;
  }

  .reducer-card .reducer-status {
    margin-left: auto;
  }

  .reducer-card .reducer-application {
    margin-top: 0;
    font-size: 8px;
  }

  .reducer-card h3 {
    margin: 7px 0 4px;
    font-size: 14px;
    line-height: 1.2;
  }

  .reducer-card .reducer-rpm {
    margin-top: 0;
    font-size: 15px;
  }

  .reducer-card .reducer-thumb {
    height: 135px;
    margin: 11px 0 0;
  }

  .reducer-card .thumb-actions {
    opacity: 1;
    background: linear-gradient(180deg, transparent 45%, rgba(14, 15, 12, .68));
    justify-content: flex-end;
    align-items: flex-end;
    padding: 9px;
  }

  .reducer-card .thumb-actions button {
    display: none;
  }

  .reducer-card .thumb-actions button:first-child {
    display: block;
    padding: 7px 10px;
    font-size: 9px;
  }

  .reducer-card .reducer-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 9px;
    padding-top: 9px;
  }

  .reducer-card .reducer-card-actions > * {
    display: none !important;
  }

  .reducer-card .reducer-card-actions [data-manutencao],
  .reducer-card .reducer-card-actions [data-edit-reducer] {
    display: block !important;
    flex: 1;
    min-width: 0;
    padding: 8px 5px;
    font-size: 9px;
  }
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .stat-card:hover {
  box-shadow: 0 12px 22px rgba(0, 0, 0, .28), 0 24px 46px rgba(239, 121, 82, .1), inset 0 1px 0 rgba(255, 255, 255, .06);
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .view-heading > .date {
  background: #1c2a1e;
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) > .panel.dashboard-alerts {
  border-color: #493029;
  background: linear-gradient(110deg, #241d1a, var(--card));
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .dashboard-grid > .panel:last-child {
  background: linear-gradient(145deg, var(--card), #18202a);
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .module-card {
  background: rgba(255, 255, 255, .035);
}

/* Dark theme palette: near-black canvas with graphite surfaces. */
:root[data-theme='dark'] {
  --paper: #0D0D0D;
  --card: #1B1B1B;
  --line: #383838;
  --side: #0D0D0D;
}

:root[data-theme='dark'] body {
  background:
    radial-gradient(circle at 90% -10%, rgba(239, 121, 82, .08), transparent 30rem),
    #0D0D0D;
}

:root[data-theme='dark'] .sidebar,
:root[data-theme='dark'] .app-header {
  background: #0D0D0D;
}

:root[data-theme='dark'] .panel,
:root[data-theme='dark'] .stat-card,
:root[data-theme='dark'] .warehouse-card,
:root[data-theme='dark'] .module-card,
:root[data-theme='dark'] .battery-overview-card,
:root[data-theme='dark'] .piece-card,
:root[data-theme='dark'] .sent-budget-card,
:root[data-theme='dark'] .reducer-card {
  background: #1B1B1B;
  border-color: #383838;
}

:root[data-theme='dark'] input,
:root[data-theme='dark'] select,
:root[data-theme='dark'] textarea,
:root[data-theme='dark'] .global-search,
:root[data-theme='dark'] .global-search kbd {
  background: #151515;
  border-color: #383838;
}

:root[data-theme='dark'] .reducer-filter-panel {
  background: #242424;
  border-color: #383838;
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .view-heading {
  border-color: #383838;
  background:
    radial-gradient(circle at 86% 50%, rgba(239, 121, 82, .1), transparent 13rem),
    linear-gradient(110deg, #1B1B1B 0%, #141414 100%);
}

:root[data-theme='dark'] .main-content:has(.dashboard-grid) .stat-card {
  background: linear-gradient(145deg, #1B1B1B 0%, #151515 100%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .26), 0 20px 42px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .04);
}

/* Sidebar follows the active theme as well. */
:root:not([data-theme='dark']) .sidebar {
  background: #D3D3D3;
  color: #20231F;
  box-shadow: 10px 0 32px rgba(62, 62, 62, .1);
}

:root:not([data-theme='dark']) .brand,
:root:not([data-theme='dark']) .sidebar-foot strong {
  color: #20231F;
}

:root:not([data-theme='dark']) .brand small,
:root:not([data-theme='dark']) .sidebar-foot small {
  color: #4F4F4F;
}

:root:not([data-theme='dark']) .workspace {
  border-color: #9B9B9B;
  background: #BDBDBD;
  color: #383838;
}

:root:not([data-theme='dark']) .workspace b,
:root:not([data-theme='dark']) .side-nav p {
  color: #5C5C5C;
}

:root:not([data-theme='dark']) .side-nav a {
  color: #202020;
}

:root:not([data-theme='dark']) .side-nav a span,
:root:not([data-theme='dark']) .side-nav a i {
  color: #383838;
}

:root:not([data-theme='dark']) .side-nav a:hover,
:root:not([data-theme='dark']) .side-nav a.active {
  color: #20231F;
  background: #BDBDBD;
}

:root:not([data-theme='dark']) .side-nav a svg {
  stroke: #383838 !important;
}

:root:not([data-theme='dark']) .side-nav a.active {
  color: #FFFFFF;
  background: #383838;
}

:root:not([data-theme='dark']) .side-nav a.active svg {
  stroke: #FFFFFF !important;
}

:root:not([data-theme='dark']) .side-nav a.active span,
:root:not([data-theme='dark']) .side-nav a:hover span {
  color: var(--orange);
}

:root:not([data-theme='dark']) .side-nav a.active i {
  color: #FFFFFF;
}

.side-subnav-piece {
  display: none;
  align-items: center;
  gap: 8px;
  width: calc(100% - 25px);
  margin: -2px 0 3px 25px;
  padding: 7px 10px 7px 14px;
  border: 0;
  border-left: 1px solid rgba(174, 177, 169, .35);
  border-radius: 0 7px 7px 0;
  background: transparent;
  color: #9da39b;
  font: 9px 'DM Mono';
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.side-nav a.active + .side-subnav-piece {
  display: flex;
  animation: submenuIn .18s ease both;
}

@keyframes submenuIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.exp-close-fixed {
  position: static;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  background: #6D2B20;
  color: #fff;
  padding: 9px 13px;
  font: 10px 'DM Mono';
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .25);
  transition: background .18s ease, transform .18s ease;
}

.exp-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.exp-title-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-close-fixed:hover {
  background: var(--orange);
  transform: translateY(-1px);
}

.exp-stage {
  transition: transform .34s cubic-bezier(.2, .75, .25, 1);
}

.exp-view {
  touch-action: none;
}

.side-subnav-piece span {
  color: var(--orange);
  font-size: 14px;
}

.side-subnav-piece:hover {
  background: rgba(223, 82, 45, .1);
  color: #fff;
}

.sidebar-collapsed .side-subnav-piece {
  display: none;
}

#mainContent:has(.piece-grid) > .module-form {
  display: none;
}

#mainContent:has(.reducer-grid) .new-reducer-line {
  display: none;
}

#mainContent .new-reducer-line {
  display: none !important;
}

#mainContent:has([data-material-name]) > .module-form {
  display: none;
}

.piece-quick-form {
  max-width: 640px;
}

.piece-quick-form h2 {
  margin: 5px 0 8px;
  font-size: 25px;
  letter-spacing: -.04em;
}

.piece-quick-form .technical-form {
  margin-top: 22px;
}

.piece-quick-form .config-actions {
  margin-top: 25px;
}

.piece-quick-form .config-save {
  min-width: 150px;
}

.reducer-quick-form .technical-form {
  grid-template-columns: 1.5fr 1fr;
}

:root:not([data-theme='dark']) .side-subnav-piece {
  border-left-color: #9B9B9B;
  color: #4A4A4A;
}

:root:not([data-theme='dark']) .side-subnav-piece:hover {
  background: #BDBDBD;
  color: #202020;
}

:root[data-theme='dark'] .side-subnav-piece {
  color: #B7BDB5;
}

:root[data-theme='dark'] .side-subnav-piece:hover {
  background: #383838;
  color: #fff;
}

@media (max-width: 700px) {
  .side-subnav-piece {
    width: calc(100% - 22px);
    margin-left: 22px;
  }

  .piece-quick-form h2 {
    font-size: 22px;
  }

  .reducer-quick-form .technical-form {
    grid-template-columns: 1fr;
  }

  .exp-close-fixed {
    padding: 8px 10px;
  }

  .exp-title-line {
    gap: 7px;
  }

  .exp-title-line strong {
    font-size: 13px;
  }
}

.reducer-status.available {
  color: #3F8053;
  background: #E7F2E9;
}

.reducer-status.available::before {
  background: #4D9061;
}

:root[data-theme='dark'] .reducer-status.available {
  color: #8BD49A;
  background: #1D3323;
}

:root[data-theme='dark'] .reducer-status.available::before {
  background: #72C886;
}

:root:not([data-theme='dark']) .sidebar-foot {
  border-top-color: #858585;
}

:root:not([data-theme='dark']) .sidebar-foot button {
  color: #383838;
}

:root:not([data-theme='dark']) .sidebar-toggle {
  border-color: #858585;
  background: rgba(211, 211, 211, .55);
  color: #383838;
}

/* Initial splash: short, branded and purposeful */
.splash:not(.access-transition) {
  overflow: hidden;
  background-color: #0D0D0D;
  background-image:
    linear-gradient(rgba(56, 56, 56, .28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 56, 56, .28) 1px, transparent 1px),
    linear-gradient(145deg, #171717, #0D0D0D);
  background-size: 36px 36px, 36px 36px, auto, auto;
}

.splash:not(.access-transition)::before {
  content: '';
  position: absolute;
  width: min(72vw, 560px);
  height: min(72vw, 560px);
  border: 1px solid rgba(223, 82, 45, .09);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(223, 82, 45, .012), 0 0 0 52px rgba(223, 82, 45, .006);
  animation: splashRadar 7s ease-in-out infinite;
}

.splash-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 380px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.splash-card .brand-mark {
  position: relative;
  overflow: visible;
  width: 86px;
  height: 86px;
  margin-bottom: 23px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: #383838;
  box-shadow: 0 0 0 4px rgba(56, 56, 56, .35), 0 0 18px rgba(0, 0, 0, .3);
  animation: splashLogo 1.8s ease-in-out infinite;
}

.splash-card .brand-mark::before,
.splash-card .brand-mark::after {
  content: '';
  position: absolute;
  inset: -7px;
  z-index: 0;
  border: 1px solid rgba(223, 82, 45, .16);
  border-top: 2px solid rgba(244, 128, 88, .9);
  border-right-color: transparent;
  border-radius: 50%;
  pointer-events: none;
  animation: splashOrbitLight 2.2s linear infinite;
}

.splash-card .brand-mark::after {
  inset: -10px;
  border-color: transparent;
  border-left: 1px solid rgba(244, 128, 88, .32);
  animation-direction: reverse;
  animation-duration: 3.4s;
}

.splash-card .brand-mark img {
  position: relative;
  z-index: 1;
}

.splash-card h1 {
  position: relative;
  width: fit-content;
  margin-inline: auto;
  overflow: hidden;
  font-size: 29px;
  letter-spacing: .16em;
  clip-path: inset(0 100% 0 0);
  text-shadow: 0 0 7px rgba(244, 128, 88, .22);
  animation: laserWrite 1.15s .15s cubic-bezier(.2, .75, .25, 1) forwards;
}

.splash-wordmark {
  display: block;
  width: 100%;
  max-width: 380px;
  height: 50px;
  margin: 0 auto;
  overflow: visible;
  transform: translateX(0);
}

.splash-wordmark text {
  font-family: Manrope, Arial, sans-serif;
  font-size: 33px;
  font-weight: 800;
  letter-spacing: 0;
  paint-order: stroke fill;
}

.splash-letter-outline {
  fill: transparent;
  stroke: #F48058;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  filter: drop-shadow(0 0 4px rgba(244, 128, 88, .62));
  animation: laserLetter .13s linear forwards;
  animation-delay: calc(.04s + (var(--letter-index) * .17s));
}

.splash-letter-fill {
  fill: #F3F1EC;
  stroke: none;
  opacity: 0;
  animation: laserLetterFill .06s ease-out forwards;
  animation-delay: calc(.04s + (var(--letter-index) * .17s) + .13s);
}

.splash-word-outline {
  fill: transparent;
  stroke: #F48058;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
  filter: drop-shadow(0 0 4px rgba(244, 128, 88, .65));
  animation: laserTrace 1.8s .12s ease-in-out forwards;
}

.splash-word-fill {
  fill: #F3F1EC;
  stroke: none;
  opacity: 0;
  animation: laserFill .35s 1.5s ease-out forwards;
}

@keyframes laserTrace {
  to { stroke-dashoffset: 0; }
}

@keyframes laserFill {
  to { opacity: 1; }
}

@keyframes laserLetter {
  to { stroke-dashoffset: 0; }
}

@keyframes laserLetterFill {
  to { opacity: 1; }
}

.splash:not(.access-transition) .splash-card h1::after {
  content: '';
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 0;
  width: 2px;
  background: #F48058;
  box-shadow: 0 0 7px #F48058, 0 0 15px rgba(244, 128, 88, .55);
  animation: laserCursor 1.15s .15s cubic-bezier(.2, .75, .25, 1) forwards;
}

@keyframes laserWrite {
  to { clip-path: inset(0 0 0 0); }
}

@keyframes laserCursor {
  0% { left: 0; opacity: 1; }
  94% { left: 100%; opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.splash-sub {
  margin-top: 8px;
  margin-bottom: 30px;
  color: #D3D3D3;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3.4px;
}

.splash-track {
  width: min(230px, 72vw);
  height: 3px;
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .025);
}

.splash-bar {
  background: linear-gradient(90deg, #f48058, #df522d);
  box-shadow: 0 0 14px rgba(223, 82, 45, .7);
  transition: width .1s linear;
}

.splash-text {
  margin-top: 14px;
  color: #b3bcb2;
  font-size: 9px;
  letter-spacing: 1px;
}

.splash-card::after {
  content: 'MANTIQUEIRA SMART  /  SISTEMA OPERACIONAL';
  display: block;
  margin-top: 42px;
  color: rgba(190, 202, 190, .45);
  font: 8px 'DM Mono';
  letter-spacing: 1px;
}

@keyframes splashLogo {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.035); }
}

@keyframes splashRadar {
  0%, 100% { opacity: .55; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.02); }
}

@keyframes splashOrbitLight {
  to { transform: rotate(360deg); }
}

:root[data-theme='dark'] .splash:not(.access-transition) {
  background-image:
    linear-gradient(rgba(56, 56, 56, .28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 56, 56, .28) 1px, transparent 1px),
    linear-gradient(145deg, #171717, #0D0D0D);
}

/* Light theme uses a soft gray surface instead of pure white. */
:root:not([data-theme='dark']) {
  --paper: #D3D3D3;
  --card: #E6E6E6;
  --line: #9B9B9B;
}

:root:not([data-theme='dark']) body {
  background:
    radial-gradient(circle at 90% -10%, rgba(223, 82, 45, .07), transparent 30rem),
    #D3D3D3;
}

:root:not([data-theme='dark']) .app-header {
  background: rgba(211, 211, 211, .92);
  border-bottom-color: #9B9B9B;
}

:root:not([data-theme='dark']) .panel,
:root:not([data-theme='dark']) .stat-card,
:root:not([data-theme='dark']) .warehouse-card,
:root:not([data-theme='dark']) .module-card,
:root:not([data-theme='dark']) .battery-overview-card,
:root:not([data-theme='dark']) .piece-card,
:root:not([data-theme='dark']) .sent-budget-card,
:root:not([data-theme='dark']) .reducer-card {
  background: #E6E6E6;
  border-color: #9B9B9B;
}

:root:not([data-theme='dark']) input,
:root:not([data-theme='dark']) select,
:root:not([data-theme='dark']) textarea,
:root:not([data-theme='dark']) .global-search,
:root:not([data-theme='dark']) .global-search kbd {
  background: #E1E1E1;
  border-color: #9B9B9B;
}

:root:not([data-theme='dark']) .reducer-filter-panel {
  background: #C7C7C7;
  border-color: #9B9B9B;
}

:root:not([data-theme='dark']) .main-content:has(.dashboard-grid) .view-heading {
  border-color: #9B9B9B;
  background:
    radial-gradient(circle at 86% 50%, rgba(223, 82, 45, .1), transparent 13rem),
    linear-gradient(110deg, #E6E6E6 0%, #D3D3D3 100%);
}

:root:not([data-theme='dark']) .main-content:has(.dashboard-grid) .stat-card {
  background: linear-gradient(145deg, #E6E6E6 0%, #D9D9D9 100%);
  box-shadow: 0 8px 18px rgba(62, 62, 62, .11), 0 20px 42px rgba(62, 62, 62, .07), inset 0 1px 0 rgba(255, 255, 255, .5);
}

:root:not([data-theme='dark']) .main-content:has(.dashboard-grid) .dashboard-grid > .panel:last-child {
  background: linear-gradient(145deg, #E6E6E6, #DDE3E7);
}

@media (prefers-reduced-motion: reduce) {
  .splash:not(.access-transition)::before,
  .splash-card .brand-mark,
  .splash-card h1,
  .splash-card h1::after,
  .splash-word-outline,
  .splash-word-fill,
  .splash-letter-outline,
  .splash-letter-fill { animation: none; clip-path: none; opacity: 1; stroke-dashoffset: 0; }
}

/* The login screen is a focused access gate, not an application view. */
body:has(.login-wrap) {
  background:
    radial-gradient(circle at 50% 0%, rgba(223, 82, 45, .1), transparent 34rem),
    var(--paper);
}

body:has(.login-wrap) .sidebar,
body:has(.login-wrap) .app-header,
body:has(.login-wrap) .mobile-bottom-nav {
  display: none;
}

body:has(.login-wrap) .app-shell {
  margin-left: 0;
  min-height: 100vh;
}

body:has(.login-wrap) .main-content {
  display: grid;
  min-height: 100vh;
  max-width: none;
  padding: 30px;
  place-items: center;
}

body:has(.login-wrap) .login-wrap {
  width: min(100%, 530px);
  min-height: auto;
}

body:has(.login-wrap) .login-card {
  width: min(100%, 410px);
  margin: auto;
}

body:has(.login-wrap) .login-wrap::before {
  top: -105px;
  font-size: clamp(30px, 6vw, 72px);
}

.access-transition-active .login-card {
  opacity: 0;
  transform: scale(.96) translateY(8px);
  transition: opacity .45s ease, transform .45s ease;
}

.splash.access-transition {
  background: rgba(28, 31, 27, .94);
  opacity: 1;
  transition: opacity .35s ease;
}

.splash.access-transition .splash-card {
  transform: scale(.88);
  opacity: 0;
  transition: opacity .3s ease, transform .45s cubic-bezier(.2, .8, .3, 1);
}

.splash.access-transition.access-transition-ready .splash-card {
  transform: scale(1);
  opacity: 1;
}

.splash.access-transition .splash-track,
.splash.access-transition .splash-sub {
  display: none;
}

.splash.access-transition .splash-text {
  margin-top: 18px;
  color: #dce4da;
  font-size: 11px;
  letter-spacing: 1.2px;
}

.splash.access-transition .splash-text::before {
  content: '\2713';
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  margin-right: 8px;
  border: 1px solid #76be83;
  border-radius: 50%;
  color: #8dd899;
}

.splash.access-transition.hidden {
  opacity: 0;
}

@media (max-width: 700px) {
  body:has(.login-wrap) .main-content {
    padding: 22px 16px;
  }

  body:has(.login-wrap) .login-wrap::before {
    top: -70px;
    font-size: 25px;
  }
}
