@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,500;9..144,600&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-accent);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

h1, h2, h3, .brand-serif {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ----- Login ----- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  border-radius: 50%;
  background: var(--login-glow);
  filter: blur(80px);
  top: -10%;
  right: -5%;
  pointer-events: none;
  animation: floatGlow 8s ease-in-out infinite alternate;
}

@keyframes floatGlow {
  from { transform: translate(0, 0); }
  to { transform: translate(-40px, 30px); }
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: var(--shadow);
  position: relative;
  animation: fadeUp 0.55s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.login-card .logo {
  font-size: 1.75rem;
  margin: 0 0 0.35rem;
}

.login-card .subtitle {
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input,
.field select {
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 25%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, background 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  margin-top: 0.5rem;
}

[data-theme="graphite"] .btn-primary {
  color: #111;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: color-mix(in srgb, var(--danger) 15%, var(--surface));
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}

.alert-ok {
  background: color-mix(in srgb, var(--success) 15%, var(--surface));
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
}

.theme-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.theme-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.theme-dot:hover,
.theme-dot.active {
  transform: scale(1.12);
  border-color: var(--accent-2);
}

.theme-dot[data-theme-pick="slate"] { background: linear-gradient(135deg, #1e293b, #38bdf8); }
.theme-dot[data-theme-pick="ocean"] { background: linear-gradient(135deg, #0b3a5c, #22d3ee); }
.theme-dot[data-theme-pick="forest"] { background: linear-gradient(135deg, #14532d, #34d399); }
.theme-dot[data-theme-pick="sunset"] { background: linear-gradient(135deg, #7c2d12, #fb923c); }
.theme-dot[data-theme-pick="midnight"] { background: linear-gradient(135deg, #070b14, #818cf8); }
.theme-dot[data-theme-pick="graphite"] { background: linear-gradient(135deg, #0a0a0a, #e5e5e5); }

/* ----- App shell ----- */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.app-titlebar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0.65rem 1.5rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--border) 60%, transparent);
}

.titlebar-left,
.titlebar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.titlebar-titles {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.titlebar-app {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.titlebar-company {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(520px, 42vw);
  line-height: 1.2;
}

.titlebar-cnpj {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.titlebar-page {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar-sync {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
}

.sync-dot.is-on {
  background: var(--success);
  opacity: 1;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
}

.user-menu {
  position: relative;
}

.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: min(320px, 46vw);
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.user-menu-btn:hover,
.user-menu.open .user-menu-btn {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.user-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

[data-theme="graphite"] .user-avatar {
  color: #111;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
}

.user-meta strong {
  font-size: 0.86rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.user-meta small {
  color: var(--text-muted);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.user-caret {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-right: 0.2rem;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: min(260px, 90vw);
  padding: 0.45rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: fadeUp 0.18s ease both;
  z-index: 40;
}

.user-dropdown-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}

.user-dropdown-head strong {
  font-size: 0.92rem;
}

.user-dropdown-head span {
  color: var(--text-muted);
  font-size: 0.78rem;
  word-break: break-all;
}

.user-dropdown-item {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.user-dropdown-item:hover {
  background: var(--surface-2);
}

.user-dropdown-danger {
  color: var(--danger);
}

.user-dropdown-sep {
  height: 1px;
  margin: 0.35rem 0.4rem;
  background: var(--border);
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  padding: 0 0.5rem;
}

.sidebar .brand h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--sidebar-text);
}

.sidebar .brand small {
  color: var(--sidebar-muted);
  font-size: 0.8rem;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  color: var(--sidebar-muted);
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.nav-list a:hover,
.nav-list a.active {
  background: color-mix(in srgb, var(--sidebar-active) 18%, transparent);
  color: var(--sidebar-text);
}

.nav-list a.active {
  box-shadow: inset 3px 0 0 var(--sidebar-active);
}

.sidebar-foot {
  margin-top: auto;
  padding: 0.5rem;
  border-top: 1px solid color-mix(in srgb, var(--sidebar-text) 12%, transparent);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.main {
  padding: 1.5rem 1.75rem 2.5rem;
  animation: fadeUp 0.45s ease both;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.topbar h2 {
  margin: 0;
  font-size: 1.6rem;
}

.topbar .meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-title {
  margin: 0.5rem 0 0.85rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.kpi-danger .value {
  color: var(--danger);
}

.sidebar-cadastros {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
}

.sidebar-cadastros .sc-item {
  background: color-mix(in srgb, var(--sidebar-text) 8%, transparent);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-cadastros .sc-item span {
  font-size: 0.68rem;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sidebar-cadastros .sc-item strong {
  font-size: 0.95rem;
  color: var(--sidebar-text);
}

.caixa-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}

.caixa-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  background: var(--surface-2);
}

.caixa-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.caixa-head span {
  color: var(--text-muted);
}

.caixa-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.caixa-kpis div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.caixa-kpis span {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.caixa-kpis strong {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

.caixa-fpg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.fpg-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  display: flex;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.78rem;
}

.fpg-chip span {
  color: var(--text-muted);
}

.topbar .btn-ghost {
  width: auto;
  padding: 0.55rem 0.9rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease both;
}

.kpi-card:nth-child(2) { animation-delay: 0.05s; }
.kpi-card:nth-child(3) { animation-delay: 0.1s; }
.kpi-card:nth-child(4) { animation-delay: 0.15s; }

.kpi-card .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-card .value {
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.kpi-card .hint {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ----- Minhas vendas ----- */
.mv-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.mv-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.15rem;
  padding: 1.5rem 1.6rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)) 0%, var(--surface) 48%, var(--surface-2) 100%);
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease both;
}

.mv-hero-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.mv-hero-sub {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.mv-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.mv-stat {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  backdrop-filter: blur(6px);
}

.mv-stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.mv-stat strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.mv-stat small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.mv-stat-time {
  font-size: 1rem !important;
  letter-spacing: 0.02em;
}

.mv-today {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.15rem;
  padding: 1.15rem 1.4rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: fadeUp 0.55s ease both;
}

.mv-today-copy h3 {
  margin: 0.15rem 0 0.25rem;
  font-size: 1.25rem;
}

.mv-today-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.mv-today-metrics {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.mv-today-metrics strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.mv-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.mv-panel {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 0.85rem;
  animation: fadeUp 0.6s ease both;
}

.mv-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.mv-panel header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.mv-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

.mv-badge-ok {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, transparent);
}

.mv-badge-lost {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.mv-panel-ok {
  border-top: 3px solid var(--success);
}

.mv-panel-lost {
  border-top: 3px solid var(--danger);
}

.mv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mv-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--border) 85%, transparent);
}

.mv-list li:last-child {
  border-bottom: 0;
}

.mv-list span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.mv-list strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.02rem;
  text-align: right;
}

/* ----- Operacao ----- */
.op-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.15rem;
}

.op-summary-card {
  padding: 1.05rem 1.15rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%, var(--surface) 55%);
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease both;
}

.op-summary-card strong {
  display: block;
  margin-top: 0.2rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.op-summary-card small {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.op-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.op-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.op-panel {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1rem;
  animation: fadeUp 0.55s ease both;
}

.op-panel-wide {
  margin-bottom: 0.5rem;
}

.op-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.op-panel header h3 {
  margin: 0.1rem 0 0;
  font-size: 1.2rem;
}

.op-rank {
  list-style: none;
  margin: 0;
  padding: 0;
}

.op-rank li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--border) 85%, transparent);
}

.op-rank li:last-child {
  border-bottom: 0;
}

.op-rank-n {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.op-rank-name {
  color: var(--text);
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-rank strong {
  font-variant-numeric: tabular-nums;
  font-size: 0.98rem;
}

.op-sellers {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.op-seller {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
}

.op-seller-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.op-seller-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  flex-shrink: 0;
}

.op-seller-head strong {
  display: block;
  font-size: 0.98rem;
}

.op-seller-head small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.op-seller-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.op-seller-metrics span {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.op-seller-metrics strong {
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.op-table-wrap {
  overflow: auto;
  margin-top: 1rem;
}

/* ----- Financeiro ----- */
.fin-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.15rem;
  animation: fadeUp 0.5s ease both;
}

.fin-hero-day {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.fin-hero-day-card {
  padding: 1.25rem 1.35rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.fin-hero-in {
  border-top: 3px solid var(--success);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--success) 10%, var(--surface)) 0%, var(--surface) 55%);
}

.fin-hero-out {
  border-top: 3px solid var(--danger);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--danger) 9%, var(--surface)) 0%, var(--surface) 55%);
}

.fin-hero-day-card h3 {
  margin: 0.15rem 0 0.55rem;
  font-size: 1.15rem;
}

.fin-hero-day-card .mv-hero-value {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.fin-neg {
  color: var(--danger) !important;
}

.fin-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.fin-panel {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.1rem;
  animation: fadeUp 0.55s ease both;
}

.fin-panel-in {
  border-top: 3px solid var(--success);
}

.fin-panel-out {
  border-top: 3px solid var(--danger);
}

.fin-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.fin-panel header h3 {
  margin: 0.1rem 0 0;
  font-size: 1.2rem;
}

.fin-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.fin-status {
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: color-mix(in srgb, var(--surface-2) 50%, var(--surface));
}

.fin-status strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.fin-status-ok {
  border-color: color-mix(in srgb, var(--success) 28%, var(--border));
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
}

.fin-status-warn {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.fin-status-danger {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.fin-status-danger strong {
  color: var(--danger);
}

/* ----- Notas & Vendas ----- */
.nv-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.15rem;
  padding: 1.5rem 1.6rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)) 0%, var(--surface) 48%, var(--surface-2) 100%);
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease both;
}

.nv-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.nv-panel {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.1rem;
  animation: fadeUp 0.55s ease both;
}

.nv-panel-nf {
  border-top: 3px solid var(--accent);
}

.nv-panel-sales {
  border-top: 3px solid var(--success);
}

.nv-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.nv-panel header h3 {
  margin: 0.1rem 0 0;
  font-size: 1.2rem;
}

.nv-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

/* ----- Visao geral ----- */
.ov-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.15rem;
  padding: 1.5rem 1.6rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)) 0%, var(--surface) 50%, var(--surface-2) 100%);
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease both;
}

.ov-day-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ov-day-panel {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.1rem;
  animation: fadeUp 0.55s ease both;
}

.ov-day-in {
  border-top: 3px solid var(--success);
}

.ov-day-out {
  border-top: 3px solid var(--danger);
}

.ov-day-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ov-day-panel header h3 {
  margin: 0.1rem 0 0;
  font-size: 1.2rem;
}

.ov-day-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.ov-day-sub {
  margin: 0.4rem 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.ov-day-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.ov-day-meta strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.ov-alerts {
  margin-bottom: 1.15rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--border));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  animation: fadeUp 0.45s ease both;
}

.ov-alerts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.ov-alerts-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.ov-alerts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ov-alert {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.ov-alert-vencido {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
  color: var(--danger);
}

.ov-alert-pagar {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
}

.ov-alert-receber {
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
}

.ov-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.ov-compare-card {
  padding: 1.05rem 1.15rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ov-compare-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.ov-compare-values small {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.ov-compare-values strong {
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
}

.ov-compare-note {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ov-delta {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ov-delta-up { color: var(--success); }
.ov-delta-down { color: var(--danger); }
.ov-delta-flat { color: var(--text-muted); }

.nav-with-badge {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.nav-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.loja-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.loja-switch select {
  max-width: 180px;
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
}

.export-menu {
  position: relative;
}

.export-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 160px;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 40;
}

.export-dropdown a {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
}

.export-dropdown a:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.btn-sm {
  padding: 0.35rem 0.7rem !important;
  font-size: 0.8rem !important;
}

.account-hint {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem 1.1rem 0.5rem;
  box-shadow: var(--shadow);
  min-height: 320px;
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.chart-card .sub {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}

.tables-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.1rem;
  box-shadow: var(--shadow);
  overflow: auto;
}

.table-card h3 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--border);
}

table.data th {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

table.data td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.empty-state {
  color: var(--text-muted);
  padding: 1.5rem 0.5rem;
  text-align: center;
  font-size: 0.95rem;
}

.panel-section {
  display: none;
}

.panel-section.active {
  display: block;
  animation: fadeUp 0.4s ease both;
}

.account-form {
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}

.account-profile {
  padding: 1.5rem 1.35rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--surface)) 0%, var(--surface) 55%, var(--surface-2) 100%);
  box-shadow: var(--shadow);
  text-align: center;
  animation: fadeUp 0.45s ease both;
}

.account-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent);
}

[data-theme="graphite"] .account-avatar {
  color: #111;
}

.account-profile h2 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.account-email {
  margin: 0 0 1.15rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  word-break: break-all;
}

.account-meta {
  margin: 0;
  text-align: left;
  display: grid;
  gap: 0.75rem;
}

.account-meta > div {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.account-meta dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.account-meta dd {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.account-panel {
  padding: 1.35rem 1.4rem 1.5rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: fadeUp 0.55s ease both;
}

.account-panel-head {
  margin-bottom: 1.15rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--border);
}

.account-panel-head h3 {
  margin: 0.15rem 0 0.35rem;
  font-size: 1.35rem;
}

.account-panel-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.account-form-modern .field {
  margin-bottom: 0.95rem;
}

.account-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.account-submit {
  width: auto;
  min-width: 180px;
  margin-top: 0.35rem;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.65rem;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1100px) {
  .kpi-grid,
  .kpi-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .charts-grid,
  .tables-grid { grid-template-columns: 1fr; }
  .op-summary { grid-template-columns: repeat(2, 1fr); }
  .op-grid { grid-template-columns: 1fr; }
  .fin-hero,
  .fin-panels,
  .nv-hero,
  .nv-panels,
  .ov-hero,
  .ov-day-panels,
  .ov-compare,
  .fin-hero-day { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-titlebar {
    padding: 0.55rem 0.9rem;
  }

  .titlebar-sync {
    display: none;
  }

  .titlebar-company {
    max-width: min(220px, 48vw);
    font-size: 0.95rem;
  }

  .titlebar-cnpj {
    font-size: 0.72rem;
  }

  .user-meta {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 0;
    padding: 0;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 86vw);
    height: 100vh;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.nav-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-list {
    flex-direction: column;
  }

  .sidebar-foot {
    width: 100%;
  }

  .main {
    padding: 1rem;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .topbar h2 {
    font-size: 1.35rem;
  }

  .kpi-card .value {
    font-size: 1.25rem;
  }

  .chart-card {
    min-height: 260px;
  }

  .mv-hero,
  .mv-panels,
  .op-grid,
  .op-summary,
  .fin-hero,
  .fin-panels,
  .nv-hero,
  .nv-panels,
  .ov-hero,
  .ov-day-panels,
  .ov-compare {
    grid-template-columns: 1fr;
  }

  .mv-today {
    flex-direction: column;
    align-items: flex-start;
  }

  .op-seller-metrics {
    grid-template-columns: 1fr;
  }

  .fin-status-grid,
  .nv-status-grid {
    grid-template-columns: 1fr;
  }

  .ov-day-meta,
  .ov-compare-values {
    grid-template-columns: 1fr;
  }

  .loja-switch {
    display: none;
  }

  .account-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .kpi-grid,
  .kpi-grid-3 {
    grid-template-columns: 1fr;
  }

  .sidebar-cadastros {
    grid-template-columns: 1fr 1fr;
  }

  .caixa-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .topbar .btn-ghost {
    width: 100%;
  }

  .theme-row {
    justify-content: flex-start;
  }

  table.data {
    font-size: 0.8rem;
  }

  table.data th,
  table.data td {
    padding: 0.45rem 0.3rem;
    white-space: nowrap;
  }

  .mv-hero {
    padding: 1.15rem;
  }

  .mv-hero-stats {
    grid-template-columns: 1fr;
  }

  .mv-today-metrics {
    width: 100%;
    justify-content: space-between;
  }

  .account-form-row {
    grid-template-columns: 1fr;
  }

  .account-submit {
    width: 100%;
  }
}
