:root {
  --green: #143f2c;
  --green2: #1f6847;
  --lime: #7bbf49;
  --gold: #f2b544;
  --ink: #17231c;
  --muted: #66736b;
  --paper: #fff;
  --bg: #f3f6f1;
  --line: #dce4dc;
  --danger: #b53636;
  --shadow: 0 16px 44px rgba(20, 63, 44, 0.11);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0, #dcebd6 0, transparent 33%), var(--bg);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.splash {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}
.splash img {
  width: 92px;
  margin: auto;
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 500px) 1fr;
}
.login-panel {
  background: var(--paper);
  padding: clamp(28px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}
.login-art {
  display: flex;
  align-items: flex-end;
  padding: 7vw;
  background:
    linear-gradient(140deg, rgba(20, 63, 44, 0.92), rgba(31, 104, 71, 0.84)),
    url("/inventory/static/logo.svg") center/45% no-repeat;
  color: white;
}
.login-art h2 {
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.98;
  max-width: 780px;
  margin: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 42px;
}
.brand img {
  width: 54px;
}
.brand strong {
  font-size: 1.35rem;
}
.brand span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--green2);
  font-size: 0.72rem;
}
h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
  margin: 0.25em 0;
}
.lede {
  color: var(--muted);
  line-height: 1.6;
}
.field {
  display: grid;
  gap: 7px;
  margin: 16px 0;
}
.field label {
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--muted);
}
input,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--green2);
  box-shadow: 0 0 0 3px rgba(31, 104, 71, 0.13);
}
.btn {
  border: 0;
  border-radius: 11px;
  padding: 13px 18px;
  font-weight: 800;
  background: var(--green);
  color: #fff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.btn:hover {
  background: var(--green2);
}
.btn.secondary {
  background: #e4eee4;
  color: var(--green);
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn.danger {
  background: #f9e1e1;
  color: var(--danger);
}
.btn.small {
  padding: 8px 11px;
  font-size: 0.78rem;
}
.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 255px 1fr;
}
.sidebar {
  background: var(--green);
  color: #fff;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  margin-bottom: 36px;
}
.sidebar .brand span {
  color: #a9c2b4;
}
.nav {
  display: grid;
  gap: 7px;
}
.nav button {
  border: 0;
  background: transparent;
  color: #c8d9cf;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
}
.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.sidebar footer {
  position: absolute;
  bottom: 22px;
  left: 18px;
  right: 18px;
}
.user-chip {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  font-size: 0.82rem;
}
.user-chip span {
  display: block;
  color: #a9c2b4;
}
.content {
  padding: clamp(22px, 4vw, 52px);
  max-width: 1600px;
  width: 100%;
  margin: auto;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
}
.topbar h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
}
.topbar p {
  color: var(--muted);
  margin: 0.4em 0;
}
.status {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 99px;
  background: #e1f1e6;
  color: var(--green2);
  font-weight: 800;
  font-size: 0.78rem;
}
.status.offline {
  background: #f8e6d1;
  color: #9a5a0c;
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.card {
  grid-column: span 12;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(220, 228, 220, 0.9);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(20, 63, 44, 0.05);
}
.card h2 {
  font-size: 1.05rem;
  margin: 0 0 16px;
}
.stat {
  grid-column: span 3;
}
.stat b {
  font-size: 2rem;
  display: block;
}
.stat span {
  color: var(--muted);
  font-size: 0.82rem;
}
.half {
  grid-column: span 6;
}
.third {
  grid-column: span 4;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.83rem;
  white-space: nowrap;
}
th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
th {
  background: #f6f8f5;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
tr:last-child td {
  border-bottom: 0;
}
.pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 99px;
  background: #e6efe7;
  font-size: 0.7rem;
  font-weight: 800;
}
.pill.warn {
  background: #fff0ce;
  color: #8b5900;
}
.count-shell {
  max-width: 740px;
  margin: auto;
}
.assignment {
  background: var(--green);
  color: #fff;
  padding: 20px;
  border-radius: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.assignment small {
  display: block;
  color: #b7cec0;
}
.assignment b {
  font-size: 1.15rem;
}
.search-results {
  display: grid;
  gap: 8px;
  max-height: 285px;
  overflow: auto;
  margin: 12px 0;
}
.product {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  text-align: left;
}
.product:hover,
.product.selected {
  border-color: var(--green2);
  background: #edf5ed;
}
.product span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}
.quantity {
  font-size: 2rem;
  text-align: center;
  font-weight: 800;
}
.sync-box {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: #eef3ed;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px;
}
.toast {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 99;
  background: var(--ink);
  color: #fff;
  padding: 13px 17px;
  border-radius: 11px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast.error {
  background: var(--danger);
}
dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: var(--shadow);
  max-width: 480px;
  width: calc(100% - 28px);
}
dialog::backdrop {
  background: rgba(11, 27, 18, 0.62);
}
.modal {
  padding: 24px;
}
.camera {
  width: 100%;
  border-radius: 12px;
  background: #111;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.mobile-nav {
  display: none;
}
.muted {
  color: var(--muted);
}
.import-result {
  margin-top: 14px;
}
.import-errors,
.import-success {
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 0.82rem;
}
.import-errors {
  background: #f9e1e1;
  color: #7d2525;
}
.import-success {
  background: #e1f1e6;
  color: var(--green2);
}
.import-errors ul {
  margin: 8px 0;
  padding-left: 20px;
}
.import-errors small {
  display: block;
  margin-top: 8px;
}
.launch-feedback {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #fff0ce;
  color: #765000;
  border: 1px solid #f2d993;
}
.launch-feedback span {
  font-size: 0.82rem;
}
.launch-feedback.synced {
  background: #e1f1e6;
  color: var(--green2);
  border-color: #bcddc6;
}
.launch-feedback.error {
  background: #f9e1e1;
  color: var(--danger);
  border-color: #ecc1c1;
}
.launch-feedback.sending {
  background: #e8eef8;
  color: #315787;
  border-color: #cbd8ed;
}
@media (max-width: 900px) {
  .login {
    grid-template-columns: 1fr;
  }
  .login-art {
    display: none;
  }
  .layout {
    display: block;
    padding-bottom: 74px;
  }
  .sidebar {
    display: none;
  }
  .content {
    padding: 20px;
  }
  .mobile-nav {
    position: fixed;
    z-index: 30;
    display: flex;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 7px;
    gap: 5px;
  }
  .mobile-nav button {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 9px 4px;
    font-size: 0.67rem;
    color: var(--muted);
  }
  .mobile-nav button.active {
    color: var(--green);
    font-weight: 800;
  }
  .stat {
    grid-column: span 6;
  }
  .half,
  .third {
    grid-column: span 12;
  }
  .topbar {
    align-items: center;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
}
@media (max-width: 520px) {
  .stat {
    grid-column: span 12;
  }
  .login-panel {
    padding: 26px;
  }
  .card {
    padding: 17px;
  }
  .assignment {
    display: block;
  }
  .assignment > div + div {
    margin-top: 10px;
  }
  .topbar .status span {
    display: none;
  }
}

/* Dashboard executivo público */
.public-shell {
  min-height: 100vh;
  padding: clamp(20px, 4vw, 54px);
  max-width: 1600px;
  margin: auto;
}
.public-loading,
.public-empty {
  min-height: 70vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 14px;
}
.public-loading img {
  width: 72px;
  margin: auto;
}
.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 50px;
}
.public-header .brand {
  margin: 0;
}
.live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 99px;
  color: var(--green2);
  background: #e1f1e6;
  font-size: 0.76rem;
  font-weight: 850;
}
.live-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #35a85f;
  box-shadow: 0 0 0 6px rgba(53, 168, 95, 0.14);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 10px rgba(53, 168, 95, 0);
  }
}
.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  margin-bottom: 34px;
}
.public-hero h1 {
  font-size: clamp(3rem, 7vw, 6.4rem);
  max-width: 950px;
  letter-spacing: -0.06em;
  margin: 0.12em 0;
}
.public-hero > div > p:last-child {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.06rem;
}
.hero-status {
  min-width: 230px;
  display: grid;
  gap: 8px;
  padding: 22px;
  background: var(--green);
  color: #fff;
  border-radius: 18px;
}
.hero-status span {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.68rem;
  font-weight: 900;
}
.hero-status small {
  color: #b7cec0;
}
.executive-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.metric-card,
.public-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 35px rgba(20, 63, 44, 0.06);
}
.metric-card {
  display: grid;
  gap: 7px;
  padding: 22px;
}
.metric-card span,
.metric-card small {
  color: var(--muted);
}
.metric-card b {
  font-size: 2.25rem;
  letter-spacing: -0.04em;
}
.metric-card.featured {
  background: var(--green);
  color: #fff;
}
.metric-card.featured span,
.metric-card.featured small {
  color: #bdd1c5;
}
.progress {
  height: 8px;
  background: #dce5dd;
  border-radius: 99px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: inherit;
}
.dashboard-columns {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}
.public-card {
  padding: 24px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}
.section-title h2,
.section-title p {
  margin: 0;
}
.section-title > span {
  color: var(--muted);
  font-size: 0.78rem;
}
.location-list,
.movement-list {
  display: grid;
  max-height: 520px;
  overflow: auto;
}
.location-row,
.movement {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
}
.location-row {
  grid-template-columns: auto 1fr auto;
}
.location-row i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccd4ce;
}
.location-row.started i {
  background: var(--lime);
}
.location-row span,
.movement span,
.location-row time {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 3px;
}
.movement {
  grid-template-columns: 46px 1fr auto;
}
.movement time {
  color: var(--green2);
  font-weight: 850;
}
.movement strong {
  color: var(--green2);
  text-align: right;
}
.public-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 4px 0;
  color: var(--muted);
  font-size: 0.75rem;
}

/* Relatório executivo */
.report-selector {
  margin-bottom: 18px;
}
.executive-report {
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.report-cover {
  padding: 36px;
  color: #fff;
  background: linear-gradient(135deg, #103724, #1f6847);
}
.report-cover .brand {
  margin-bottom: 70px;
}
.report-cover .brand span {
  color: #b7cec0;
}
.report-company h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  margin: 0.12em 0;
}
.report-company p:last-child {
  color: #c7d8ce;
}
.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}
.report-kpis > div {
  display: grid;
  gap: 5px;
  padding: 24px;
  border-right: 1px solid var(--line);
}
.report-kpis span,
.report-kpis small {
  color: var(--muted);
  font-size: 0.75rem;
}
.report-kpis b {
  font-size: 1.9rem;
}
.report-progress,
.report-section {
  padding: 26px 34px;
  border-bottom: 1px solid var(--line);
}
.report-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  font-size: 0.82rem;
}
.difference {
  color: var(--danger);
  font-weight: 850;
}
.location-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.location-summary > div {
  display: grid;
  gap: 4px;
  padding: 13px;
  border-radius: 10px;
  background: var(--bg);
}
.location-summary span {
  color: var(--muted);
  font-size: 0.75rem;
}
.report-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 70px 36px 34px;
}
.report-signatures div {
  border-top: 1px solid #89958d;
  padding-top: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 0.75rem;
}
.quick-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
}
.quick-toggle input {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
}
.quick-toggle span {
  display: grid;
  gap: 2px;
}
.quick-toggle small {
  color: var(--muted);
}

@media (max-width: 900px) {
  .mobile-nav {
    overflow-x: auto;
    justify-content: flex-start;
  }
  .mobile-nav button {
    min-width: 76px;
    flex: 0 0 auto;
  }
  .public-header {
    flex-wrap: wrap;
    margin-bottom: 30px;
  }
  .public-header .btn {
    display: none;
  }
  .public-hero {
    grid-template-columns: 1fr;
  }
  .public-hero h1 {
    font-size: clamp(2.8rem, 14vw, 5rem);
  }
  .executive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
  .report-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .location-summary {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .public-shell {
    padding: 18px;
  }
  .live-badge {
    order: 3;
  }
  .executive-grid {
    grid-template-columns: 1fr;
  }
  .movement {
    grid-template-columns: 42px 1fr;
  }
  .movement strong {
    grid-column: 2;
    text-align: left;
  }
  .report-kpis,
  .report-signatures {
    grid-template-columns: 1fr;
  }
  .report-cover,
  .report-section,
  .report-progress {
    padding: 22px;
  }
}
@media print {
  body {
    background: #fff;
  }
  .sidebar,
  .mobile-nav,
  .topbar,
  .no-print,
  #toast {
    display: none !important;
  }
  .layout,
  .content {
    display: block;
    padding: 0;
    max-width: none;
  }
  .executive-report {
    border: 0;
    box-shadow: none;
  }
  .report-section {
    break-inside: avoid;
  }
  .table-wrap {
    overflow: visible;
  }
  table {
    white-space: normal;
  }
}
