﻿:root {
  --bg: #f3f5fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --accent: #0f766e;
  --accent-2: #0ea5e9;
  --accent-3: #f97316;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

* {
  box-sizing: border-box;
}

body.hero-app {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 10% 0%, rgba(14, 165, 233, 0.14), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(249, 115, 22, 0.12), transparent 45%),
    radial-gradient(circle at 20% 90%, rgba(16, 185, 129, 0.12), transparent 45%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body.hero-app.modal-open {
  overflow: hidden;
}

button {
  font-family: inherit;
}

.splash {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.2);
  display: grid;
  place-items: center;
  z-index: 2000;
}

.splash.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.splash-card {
  background: white;
  padding: 24px 28px;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  min-width: 220px;
}

.splash-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 12px;
}

.splash-title {
  font-weight: 800;
  font-size: 1.1rem;
}

.splash-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.splash-loader {
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  margin: 18px auto 0;
  overflow: hidden;
  position: relative;
}

.splash-loader::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, #0f766e, transparent);
  animation: loading 1.4s ease-in-out infinite;
}

@keyframes loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes heroRise {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes heroGlow {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.03);
  }
}

@keyframes heroValue {
  0%, 100% {
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  }
  50% {
    text-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  }
}

@keyframes heroBtn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroLogoFloat {
  0%, 100% {
    transform: translateY(0) rotate(-12deg) scale(1);
    opacity: 0.55;
  }
  50% {
    transform: translateY(-10px) rotate(-6deg) scale(1.08);
    opacity: 0.7;
  }
}

@keyframes heroLogoGlow {
  0%, 100% {
    filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.28)) drop-shadow(0 0 18px rgba(255, 255, 255, 0.25));
  }
  50% {
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.32)) drop-shadow(0 0 26px rgba(255, 255, 255, 0.4));
  }
}

@keyframes chipReveal {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 18px 110px;
}

.app-footer {
  margin: 26px 0 8px;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.45);
  letter-spacing: 0.02em;
}

.auth-footer {
  margin-top: 18px;
  padding-bottom: 24px;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: sticky;
  top: 12px;
  z-index: 5;
  backdrop-filter: blur(16px);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(15, 118, 110, 0.12);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn.ghost {
  background: rgba(15, 23, 42, 0.05);
}

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

.brand-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.15), 0 10px 18px rgba(15, 23, 42, 0.12);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-text {
  display: grid;
  min-width: 0;
}

.brand-title {
  font-weight: 800;
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero {
  position: relative;
  margin-top: 14px;
}

.hero-card {
  background: linear-gradient(135deg, #0f766e, #0ea5e9);
  background-size: 200% 200%;
  color: white;
  border-radius: 26px;
  padding: 22px;
  box-shadow: 0 24px 50px rgba(15, 118, 110, 0.35);
  position: relative;
  overflow: hidden;
  animation: heroRise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both, heroGradient 10s ease-in-out infinite;
}

.hero-card.compact {
  padding: 18px;
}

.hero-card.home-hero {
  padding: 16px 18px;
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(15, 118, 110, 0.28);
}

.hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 10px 0 4px;
}

.hero-subtitle {
  margin: 0;
  opacity: 0.85;
  font-size: 0.92rem;
}

.panel-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.panel-card + .panel-card {
  margin-top: 16px;
}

.panel-title {
  font-weight: 700;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-subtitle {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.panel-section {
  display: grid;
  gap: 14px;
}

.panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-actions .btn {
  border-radius: 12px;
}

.table-wrap {
  background: #f8fafc;
  border-radius: 14px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.page-container {
  display: grid;
  gap: 16px;
}

.hero-card .muted {
  color: rgba(255, 255, 255, 0.75);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 26px 24px 22px;
  width: min(380px, 90vw);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
  text-align: center;
}

.auth-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border-radius: 22px;
  background: #f8fafc;
  padding: 12px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.auth-title {
  font-weight: 800;
  font-size: 1.3rem;
  margin: 14px 0 4px;
}

.auth-subtitle {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 0.92rem;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-field {
  position: relative;
}

.auth-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 10px 12px 10px 38px;
  font-size: 0.95rem;
}

.auth-field i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(15, 23, 42, 0.4);
}

.auth-action {
  margin-top: 6px;
}

.auth-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #0f766e, #0ea5e9);
  color: white;
}

.hero-card::after {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  right: -120px;
  top: -80px;
}

.hero-card::before {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  right: -60px;
  top: 30px;
  filter: blur(6px);
}

.hero-logo {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 96px;
  height: 96px;
  object-fit: contain;
  opacity: 0.55;
  transform: rotate(-10deg);
  pointer-events: none;
  animation: heroLogoFloat 6s ease-in-out infinite, heroLogoGlow 4.5s ease-in-out infinite;
}

.hero-card.home-hero .hero-logo {
  width: 74px;
  height: 74px;
  right: 12px;
  top: 12px;
}

.hero-bg {
  position: absolute;
  inset: 10px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.1);
  filter: blur(50px);
  z-index: -1;
  animation: heroGlow 6s ease-in-out infinite;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.pill {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.hero-value {
  font-size: 2.2rem;
  margin: 14px 0 4px;
  font-weight: 800;
  animation: heroValue 2.8s ease-in-out infinite;
}

.hero-card.home-hero .hero-value {
  font-size: 1.9rem;
  margin: 10px 0 2px;
}

.hero-label {
  margin: 0;
  opacity: 0.85;
}

.hero-card.home-hero .hero-label {
  font-size: 0.88rem;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hero-card.home-hero .hero-actions {
  margin-top: 12px;
}

.hero-card.home-hero .primary-btn,
.hero-card.home-hero .ghost-btn {
  padding: 8px 12px;
  font-size: 0.88rem;
  border-radius: 12px;
}

.hero-card.home-hero .pill {
  padding: 5px 9px;
  font-size: 0.78rem;
}

.hero-card.home-hero .hero-meta {
  font-size: 0.78rem;
}

.hero-actions .primary-btn {
  animation: heroBtn 0.8s ease both;
}

.hero-actions .ghost-btn {
  animation: heroBtn 0.8s ease 0.08s both;
}

.primary-btn,
.ghost-btn {
  border: none;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.primary-btn {
  background: white;
  color: #0f766e;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.chips {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding: 14px 4px 2px;
  margin-top: 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chips::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.chip {
  background: var(--card);
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  animation: chipReveal 0.7s ease both;
}

.section {
  margin-top: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.section-head p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.branch-grid {
  display: grid;
  gap: 14px;
}

.branch-card {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.branch-card.skeleton {
  position: relative;
  overflow: hidden;
}

.branch-card.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: loading 1.4s ease-in-out infinite;
}

.branch-cover {
  position: relative;
  height: 150px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.25), rgba(14, 165, 233, 0.25));
}

.branch-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.branch-cover .branch-title {
  position: absolute;
  left: 16px;
  bottom: 12px;
  color: white;
  font-weight: 700;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.status-chip {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-chip.status-online {
  background: rgba(16, 185, 129, 0.2);
  color: #0f766e;
}

.status-chip.status-offline {
  background: rgba(239, 68, 68, 0.22);
  color: #b91c1c;
}

.open-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  background: rgba(15, 118, 110, 0.9);
  color: white;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.branch-content {
  padding: 12px 14px 16px;
}

.branch-total {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.branch-sub {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.branch-sub strong {
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1300;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: all;
}

.branch-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  width: min(720px, calc(100% - 32px));
  height: min(88vh, calc(100% - 32px));
  background: white;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1350;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
}

.modal-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 140px;
}

.modal-hero-image {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.4), rgba(14, 165, 233, 0.45));
  background-size: cover;
  background-position: center;
  filter: saturate(1.1);
}

.modal-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.35), rgba(15, 23, 42, 0.65));
}

.modal-hero-content {
  position: relative;
  z-index: 1;
  padding: 16px;
  color: #f8fafc;
  display: grid;
  gap: 12px;
}

.modal-hero .icon-btn {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  color: #f8fafc;
}

.branch-modal.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
}

.modal-meta {
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.8);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-pill {
  background: rgba(16, 185, 129, 0.2);
  color: #f8fafc;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-pill.offline {
  background: rgba(239, 68, 68, 0.2);
}

.meta-text {
  font-size: 0.78rem;
}

.modal-chip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chip-badge {
  background: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-badge.ghost {
  background: rgba(255, 255, 255, 0.08);
}

.chip-badge.hidden {
  display: none;
}

.modal-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.modal-kpi {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06), rgba(14, 165, 233, 0.08));
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.modal-kpi span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.modal-kpi strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.trend-up {
  color: #16a34a;
}

.trend-down {
  color: #dc2626;
}

.trend-flat {
  color: #475569;
}

.trend-icon {
  margin-right: 6px;
  font-size: 0.75rem;
}

.modal-section-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.modal-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.modal-list-item .list-title {
  font-weight: 600;
}

.modal-list-item .list-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.modal-list-item strong {
  font-weight: 700;
}

.product-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.control {
  display: grid;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.control input,
.control select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  font-size: 0.85rem;
  color: var(--text);
}

.product-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-card {
  background: #f8fafc;
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.summary-card span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.summary-card strong {
  font-size: 0.98rem;
  font-weight: 800;
}

.product-accordion {
  display: grid;
  gap: 10px;
  max-height: none;
  overflow: visible;
}

.accordion-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  border: none;
  background: #f8fafc;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.accordion-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.accordion-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.accordion-total {
  font-weight: 800;
  font-size: 0.92rem;
}

.category-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  margin-top: 8px;
  overflow: hidden;
}

.category-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.85), rgba(14, 165, 233, 0.85));
}

.accordion-header i {
  transition: transform 0.2s ease;
}

.accordion-item.open .accordion-header i {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding: 10px 12px 12px;
  background: #ffffff;
  gap: 8px;
}

.accordion-item.open .accordion-body {
  display: grid;
}

.accordion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.accordion-row .row-title {
  font-weight: 600;
  font-size: 0.85rem;
}

.accordion-row .row-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.accordion-row .row-amount {
  font-weight: 700;
  font-size: 0.85rem;
}

.modal-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tab-btn {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.4);
}

.tab-panels {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.tab-panel {
  display: none;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.tab-panel.active {
  display: grid;
}

.chart-card {
  background: #f8fafc;
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.chart-card canvas {
  width: 100% !important;
  height: 220px !important;
}

.chart-card #productChart {
  height: 260px !important;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.mini-card span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.mini-card strong {
  font-size: 1rem;
  font-weight: 800;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: white;
  transform: translateX(-110%);
  transition: transform 0.25s ease;
  z-index: 1200;
  box-shadow: 12px 0 28px rgba(15, 23, 42, 0.18);
  padding: 16px;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.drawer-title {
  font-weight: 700;
}

.drawer-nav {
  display: grid;
  gap: 8px;
}

.drawer-link {
  border: none;
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  font-weight: 600;
  text-decoration: none;
}

.drawer-link.active {
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
}

.drawer-link.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1100;
}

.backdrop.show {
  opacity: 1;
  pointer-events: all;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -100%;
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 12px 16px 20px;
  box-shadow: 0 -20px 40px rgba(15, 23, 42, 0.2);
  transition: bottom 0.25s ease;
  z-index: 1300;
  max-height: 85vh;
  overflow-y: auto;
}

.sheet.open {
  bottom: 0;
}

.sheet-handle {
  width: 56px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  margin: 8px auto 12px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.sheet-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.preset {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}

.sheet-fields {
  display: grid;
  gap: 10px;
}

.sheet-fields label {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.sheet-fields input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  font-size: 0.9rem;
}

.bottom-nav {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: white;
  border-radius: 20px;
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
  padding: 10px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.15);
  border: 1px solid rgba(15, 23, 42, 0.08);
  z-index: 1000;
  overflow-x: auto;
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 4px;
  text-decoration: none;
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 60px;
}

.nav-item.active,
.nav-item:active,
.nav-item:hover {
  color: #0f766e;
}

.nav-item.logout {
  border: none;
  background: transparent;
}

@media (min-width: 768px) {
  .app-shell {
    padding-bottom: 40px;
  }

  .bottom-nav {
    display: none;
  }

  .branch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .branch-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .hero-value {
    font-size: 1.7rem;
  }

  .chip {
    font-size: 0.75rem;
  }

  .branch-modal {
    width: calc(100% - 24px);
    height: min(92vh, calc(100% - 24px));
  }

  .modal-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-card canvas {
    height: 180px !important;
  }

  .chart-card #productChart {
    height: 220px !important;
  }

  .product-controls {
    grid-template-columns: 1fr;
  }
}

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