@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --accent: #0891b2;
  --accent-dark: #0e7490;
  --accent-soft: rgba(8, 145, 178, 0.12);
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --line: #e2e8f0;
  --green: #10b981;
  --green-dark: #059669;
  --green-bg: #ecfdf5;
  --red: #ef4444;
  --red-dark: #dc2626;
  --red-bg: #fef2f2;
  --r: 14px;
  --side: 250px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 28px -6px rgba(15, 23, 42, 0.1), 0 4px 10px -4px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.25);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdropFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(at 100% 0%, rgba(8, 145, 178, 0.04) 0px, transparent 50%),
                    radial-gradient(at 0% 100%, rgba(15, 23, 42, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font: 400 1rem/1.55 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

h1, h2, h3 {
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.08rem; font-weight: 600; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--accent-dark); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

em { font-style: normal; }

/* layout */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.35s var(--ease);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.25rem 1.2rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  padding: 4px;
  flex: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s var(--bounce);
}
.brand:hover img {
  transform: rotate(-4deg) scale(1.06);
}

.nav {
  list-style: none;
  margin: 0.8rem 0;
  padding: 0 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.72rem 0.95rem;
  color: #94a3b8;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.94rem;
  transition: all 0.25s var(--ease);
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  transform: translateX(3px);
}

.nav a.on {
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.22) 0%, rgba(8, 145, 178, 0.06) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(8, 145, 178, 0.3);
}

.nav a.on::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 20%;
  bottom: 20%;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.nav i {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
  transition: transform 0.25s var(--bounce), color 0.25s;
}
.nav a:hover i, .nav a.on i {
  color: #38bdf8;
  transform: scale(1.12);
}

.side-foot {
  padding: 1rem 1.2rem;
  font-size: 0.78rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.main {
  margin-left: var(--side);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.75rem;
}

.top-title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.top-title strong, .top-title b { font-weight: 600; color: var(--ink); }
.top-title span { font-size: 0.78rem; color: var(--muted); }

.top-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.top-user form { margin: 0; }

.who {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  border: 1px solid var(--line);
}
.who em {
  color: var(--muted);
  font-size: 0.78rem;
  margin-left: 0.35rem;
}

.content {
  padding: 1.75rem;
  max-width: 1440px;
  width: 100%;
  animation: fadeSlideUp 0.45s var(--ease) both;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.page-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.menu-btn, .overlay { display: none; }

/* componentes */
.card {
  background: var(--surface);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--r);
  padding: 1.4rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}
.card > h2 {
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.grid { display: grid; gap: 1.4rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.15rem;
  margin-bottom: 1.4rem;
}

.stat {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.2rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  box-shadow: var(--shadow-xs);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
  animation: fadeSlideUp 0.5s var(--ease) both;
}
.stat:nth-child(2) { animation-delay: 0.05s; }
.stat:nth-child(3) { animation-delay: 0.1s; }
.stat:nth-child(4) { animation-delay: 0.15s; }
.stat:nth-child(5) { animation-delay: 0.2s; }
.stat:nth-child(6) { animation-delay: 0.25s; }

.stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(8, 145, 178, 0.35);
}

.stat .ico {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: var(--ink);
  flex: none;
  transition: transform 0.3s var(--bounce);
}
.stat:hover .ico {
  transform: scale(1.1) rotate(-4deg);
}

.stat.green .ico {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: var(--green-dark);
}
.stat.red .ico {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: var(--red-dark);
}

.stat b {
  display: block;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  font: 500 0.92rem/1.2 inherit;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(8, 145, 178, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(8, 145, 178, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  filter: brightness(1.04);
  color: #fff;
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.btn-dark {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}
.btn-dark:hover { box-shadow: 0 6px 16px rgba(15, 23, 42, 0.35); }

.btn-green {
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}
.btn-green:hover { box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35); }

.btn-red {
  background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}
.btn-red:hover { box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35); }

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  padding: 0.36rem 0.72rem;
  font-size: 0.83rem;
  border-radius: 8px;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.45rem 0.65rem;
  border-radius: 9px;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--bounce);
}
.icon-btn:hover {
  background: #f1f5f9;
  color: var(--ink);
  transform: scale(1.08);
}

.alert {
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  margin-bottom: 1.2rem;
  border: 1px solid;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  animation: fadeSlideUp 0.35s var(--ease);
}
.alert-success { background: var(--green-bg); border-color: #a7f3d0; color: #065f46; }
.alert-error { background: var(--red-bg); border-color: #fecaca; color: #991b1b; }
.alert-info { background: #ecfeff; border-color: #a5f3fc; color: #155e75; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.b-green { background: var(--green-bg); color: var(--green-dark); border: 1px solid #a7f3d0; }
.b-greensoft { background: #fff; color: var(--green-dark); box-shadow: inset 0 0 0 1px var(--green); }
.b-red { background: var(--red); color: #fff; }
.b-redsoft { background: var(--red-bg); color: var(--red-dark); border: 1px solid #fecaca; }
.b-gray { background: #f1f5f9; color: var(--muted); border: 1px solid var(--line); }

.pos { color: var(--green-dark); font-weight: 600; font-variant-numeric: tabular-nums; }
.neg { color: var(--red-dark); font-weight: 600; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }

/* tabelas */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th:first-child { border-top-left-radius: 9px; }
th:last-child { border-top-right-radius: 9px; }

td {
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  transition: background 0.18s ease;
}

tbody tr {
  transition: transform 0.18s var(--ease), background 0.18s ease;
}
tbody tr:hover td {
  background: #f8fafc;
}
tbody tr:last-child td {
  border-bottom: 0;
}

.r { text-align: right; }
.nowrap { white-space: nowrap; }

.empty {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid var(--line);
  display: inline-grid;
  place-items: center;
  color: #94a3b8;
  flex: none;
  transition: transform 0.25s var(--bounce);
}
tr:hover .thumb {
  transform: scale(1.08);
}

.pc { display: flex; gap: 0.8rem; align-items: center; }
.pc b { color: var(--ink); display: block; font-weight: 600; }

.actions { display: flex; gap: 0.35rem; justify-content: flex-end; }
.actions form { margin: 0; }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.1rem;
  margin-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.88rem;
  color: var(--muted);
}

/* filtros e formulários */
.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}
.filters .f { display: flex; flex-direction: column; gap: 0.3rem; }
.filters label { font-size: 0.78rem; font-weight: 600; color: var(--muted); }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  width: 100%;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input:hover, select:hover, textarea:hover {
  border-color: #94a3b8;
}

input[type=checkbox] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

input[type=color] {
  padding: 0.2rem;
  height: 42px;
  width: 72px;
  cursor: pointer;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.filters input, .filters select {
  width: auto;
  min-width: 160px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.span2 { grid-column: 1 / -1; }

.fld label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.fld small { color: var(--muted); }

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f1f5f9;
  gap: 2px;
}
.seg a {
  padding: 0.38rem 0.85rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s var(--ease);
}
.seg a:hover { color: var(--ink); }
.seg a.on {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* cards de produto */
.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 1.15rem;
}

.pcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}

.pcard:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: rgba(8, 145, 178, 0.4);
}

.pcard .pimg {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  color: #94a3b8;
  transition: transform 0.5s var(--ease);
}

.pcard:hover .pimg {
  transform: scale(1.04);
}

.pcard .pb {
  position: relative;
  background: var(--surface);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.pcard .pb b { color: var(--ink); font-size: 1rem; }
.pcard .qty {
  font-size: 1.35rem;
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pcard .actions {
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid #f1f5f9;
}

/* modal (dialog nativo) */
dialog.modal {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  padding: 0;
  width: min(640px, calc(100vw - 1.5rem));
  max-height: 92vh;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

dialog.modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: backdropFade 0.25s ease-out;
}

dialog.modal[open] {
  animation: modalPop 0.3s var(--bounce);
}

.mhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--line);
}

.mbody {
  padding: 1.4rem;
  overflow: auto;
  max-height: calc(92vh - 145px);
}

.mfoot {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.modal form { margin: 0; }
.hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.3rem; }
.hint b { color: var(--ink); }

.preview {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid var(--line);
  display: block;
  margin-top: 0.5rem;
  box-shadow: var(--shadow-xs);
}

/* gráfico */
.chart { width: 100%; height: auto; }
.chart .grid { stroke: #e2e8f0; stroke-width: 1; stroke-dasharray: 4 4; }
.chart .tick { font-size: 11px; fill: var(--muted); font-family: inherit; }
.bar-in { fill: var(--green); transition: opacity 0.2s; }
.bar-out { fill: var(--red); transition: opacity 0.2s; }
.bar-in:hover, .bar-out:hover { opacity: 0.82; }

.legend {
  display: flex;
  gap: 1.2rem;
  font-size: 0.84rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
}
.legend i {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 4px;
  margin-right: 0.4rem;
}

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  padding: 0.7rem 0.4rem;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 8px;
  transition: background 0.2s, padding-left 0.2s var(--ease);
}
.list li:hover {
  background: #f8fafc;
  padding-left: 0.75rem;
}
.list li:last-child { border: 0; }

/* login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: radial-gradient(circle at top right, #1e293b, #0f172a 65%);
}

.login-box {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 22px;
  padding: 2.4rem;
  width: min(420px, 100%);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: modalPop 0.5s var(--ease);
}

.login-box .logo {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}
.login-box .logo img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: var(--shadow-sm);
}
.login-box .fld { margin-bottom: 1rem; }
.login-box .btn {
  width: 100%;
  justify-content: center;
  padding: 0.78rem;
  font-size: 1rem;
  margin-top: 0.4rem;
}

.sum {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}
.sum div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  transition: transform 0.2s var(--ease);
}
.sum div:hover { transform: translateY(-2px); }
.sum span { font-size: 0.78rem; font-weight: 500; color: var(--muted); display: block; }
.sum b { font-size: 1.3rem; color: var(--ink); font-variant-numeric: tabular-nums; }

/* responsivo */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  body.menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .menu-btn {
    position: relative;
    z-index: 46;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-size: 1.15rem;
    cursor: pointer;
    flex: none;
    transition: transform 0.2s var(--bounce), background 0.2s;
  }
  .menu-btn:active {
    transform: scale(0.92);
    background: #f1f5f9;
  }
  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    z-index: 35;
    animation: backdropFade 0.25s ease;
  }
  body.menu-open .overlay { display: block; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .content { padding: 1.15rem; }
  .topbar { padding: 0 1rem; z-index: 50; }
  .who em, .top-title span { display: none; }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .top-user .btn span { display: none; }
  .who { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Esconde qualquer imagem/aviso de carregamento solto até ser ativado */
.loading-overlay,
.validando-box,
[data-loading] {
  display: none;
}

/* Melhora o visual do autofill do navegador nos inputs do login */
.login-box input:-webkit-autofill,
.login-box input:-webkit-autofill:hover,
.login-box input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #f8fafc inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* Garante que o logo dentro do card de login nunca estoura */
.login-box .logo img {
  width: 54px;
  height: 54px;
  max-width: 54px;
  max-height: 54px;
  object-fit: contain;
  flex: none;
}

/* Correção de camadas e toque do menu responsivo */
@media (max-width: 960px) {
  .sidebar { z-index: 1202; will-change: transform; }
  .overlay { z-index: 1201; touch-action: manipulation; }
  .topbar { position: sticky; z-index: 1203 !important; }
  .menu-btn { position: relative; z-index: 1204 !important; touch-action: manipulation; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  body.menu-open .sidebar { transform: translateX(0) !important; visibility: visible; }
  body.menu-open .overlay { display: block; pointer-events: auto; }
}
