/* Foto Oriente Admin — Manual da Marca (padrão: admin/includes/BrandDefaults.php) */
:root {
  --red-primary: #E53935;
  --red-secondary: #FF6B6B;
  --red-dark: #C62828;
  --cream: #F7E8E1;
  --peach: #F2B5A7;
  --charcoal: #333333;
  --sidebar-bg: #333333;
  --white: #ffffff;
  --gray-100: #f5f5f5;
  --gray-200: #e8e8e8;
  --gray-400: #999;
  --chart-outros: #999999;
  --chart-1: #E53935;
  --chart-2: #333333;
  --chart-3: #FF6B6B;
  --chart-4: #C62828;
  --chart-5: #F2B5A7;
  --chart-6: #B71C1C;
  --chart-7: #616161;
  --chart-8: #EF5350;
  --chart-9: #8D6E63;
  --chart-10: #AD1457;
  --chart-11: #78909C;
  --chart-12: #D84315;
  --chart-13: #5D4037;
  --chart-14: #E57373;
  --chart-15: #455A64;
  --chart-16: #FFAB91;
  --chart-17: #424242;
  --chart-18: #C2185B;
  --chart-19: #A1887F;
  --chart-20: #757575;
  --shadow: 0 4px 20px rgba(229, 57, 53, 0.08);
  --shadow-lg: 0 12px 40px rgba(51, 51, 51, 0.12);
  --radius: 10px;
  --radius-lg: 14px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --font-title: 'Poppins', sans-serif;
  --font-body: 'Lato', sans-serif;
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 0px;
  --phi: 1.618;
  --space-phi-sm: 0.618rem;
  --space-phi-md: 1rem;
  --space-phi-lg: 1.618rem;
  --font-base: 0.8125rem;
  --font-sm: 0.75rem;
  --font-xs: 0.6875rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--font-base);
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--cream) 0%, var(--peach) 50%, var(--red-secondary) 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  top: -200px;
  right: -200px;
  animation: float 8s ease-in-out infinite;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(229,57,53,0.1);
  bottom: -150px;
  left: -100px;
  animation: float 6s ease-in-out infinite reverse;
}

.login-back-site {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--charcoal);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(51, 51, 51, 0.12);
  transition: var(--transition);
}

.login-back-site svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.login-back-site:hover {
  color: var(--red-primary);
  transform: translateX(-2px);
}

.login-flags {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  gap: 0.35rem;
  z-index: 2;
}

.login-flag {
  width: 26px;
  height: 18px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(51, 51, 51, 0.15);
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  animation: slideUp 0.6s var(--transition);
}

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

.login-card__brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-card__logo {
  width: 200px;
  height: auto;
  display: block;
  margin: 0 auto 1rem;
}

.login-card__brand p {
  font-size: 0.85rem;
  color: var(--gray-400);
}

/* Admin layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition), width var(--transition);
}

.admin-layout.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
}

.admin-layout.sidebar-collapsed .main-content {
  margin-left: 0;
  padding-top: 5rem;
}

.sidebar__brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar__brand-text {
  flex: 1;
  min-width: 0;
}

.sidebar-collapse-btn,
.sidebar-expand-btn,
.collapsible-panel__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.08);
  color: inherit;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-collapse-btn:hover,
.sidebar-expand-btn:hover,
.collapsible-panel__toggle:hover {
  background: rgba(229,57,53,0.25);
  border-color: var(--red-secondary);
  color: var(--red-secondary);
}

.sidebar-collapse-btn svg,
.sidebar-expand-btn svg,
.collapsible-panel__toggle svg {
  width: 20px;
  height: 20px;
}

.sidebar-expand-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 90;
  display: none;
  background: var(--sidebar-bg);
  color: var(--white);
  box-shadow: var(--shadow-lg);
}

.admin-layout.sidebar-collapsed .sidebar-expand-btn {
  display: inline-flex;
}

.main-content.has-sidebar-toggle {
  position: relative;
}

.main-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  min-height: 48px;
  gap: 0.75rem;
}

.btn.btn-back-to-site {
  text-decoration: none;
  margin-right: auto;
}

.sidebar__brand h2 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--red-secondary);
}

.sidebar__brand span {
  font-size: 0.75rem;
  opacity: 0.6;
}

.sidebar__nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar__nav a,
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.875rem;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-logout-btn {
  width: calc(100% + 3rem);
  margin: 0 -1.5rem;
  border: none;
  background: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sidebar__nav a:hover,
.sidebar__nav a.active,
.sidebar-logout-btn:hover,
.sidebar-logout-btn:focus-visible {
  background: rgba(229,57,53,0.15);
  border-left-color: var(--red-primary);
  color: var(--red-secondary);
  outline: none;
}

.sidebar__nav svg,
.sidebar-logout-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-dropdown__toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: none;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.nav-dropdown__label {
  flex: 1;
}

.nav-dropdown__chevron {
  width: 16px !important;
  height: 16px !important;
  opacity: 0.6;
  transition: transform var(--transition);
}

.nav-dropdown.open .nav-dropdown__chevron {
  transform: rotate(180deg);
}

.nav-dropdown__toggle:hover,
.nav-dropdown__toggle.active {
  background: rgba(229,57,53,0.15);
  border-left-color: var(--red-primary);
  color: var(--red-secondary);
}

.nav-dropdown__menu {
  display: none;
  padding: 0.25rem 0 0.5rem;
}

.nav-dropdown.open .nav-dropdown__menu {
  display: block;
}

.nav-dropdown__menu a {
  display: block;
  padding: 0.65rem 1.5rem 0.65rem 3.25rem;
  font-size: 0.8125rem;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.nav-dropdown__menu a:hover,
.nav-dropdown__menu a.active {
  background: rgba(229,57,53,0.1);
  border-left-color: var(--red-secondary);
  color: var(--red-secondary);
}

.sidebar__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar__user {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 1.25rem 1rem;
  animation: fadeIn 0.4s ease;
}

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

.btn.btn-back {
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  box-shadow: var(--shadow);
}

.btn.btn-back:hover,
.btn.btn-back:active {
  border-color: var(--red-primary);
  color: var(--red-primary);
  background: rgba(247, 232, 225, 0.5);
  transform: translateX(-2px);
}

.btn.btn-back svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-header h1 {
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 500;
}

.page-header p {
  color: var(--gray-400);
  font-size: var(--font-sm);
  margin-top: 0.2rem;
}

/* Cards grid (dashboard) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.dash-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.dash-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.dash-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--red-primary), var(--red-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
}

.dash-card__icon svg { width: 24px; height: 24px; }

.dash-card h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.dash-card p {
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* Dashboard priority alerts */
#dashAlerts {
  margin-bottom: 1.5rem;
}

.stock-alert {
  background: linear-gradient(135deg, #fff5f5 0%, #fffaf7 100%);
  border: 1px solid rgba(229, 57, 53, 0.22);
  border-left: 4px solid var(--red-primary);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.stock-alert__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.stock-alert__title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
}

.stock-alert__icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(229, 57, 53, 0.12);
  color: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stock-alert__title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 0.2rem;
  color: var(--charcoal);
}

.stock-alert__subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--gray-400);
}

.stock-alert__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.stock-alert__item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.85rem 1rem;
  min-width: 0;
}

.stock-alert__item-name {
  display: block;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 0.15rem;
  word-break: break-word;
}

.stock-alert__item-type {
  display: block;
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-bottom: 0.65rem;
}

.stock-alert__item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.stock-alert__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--gray-100);
  color: var(--gray-400);
}

.stock-alert__badge--danger {
  background: rgba(229, 57, 53, 0.12);
  color: var(--red-primary);
}

.stock-qty--low {
  color: var(--red-primary);
  font-weight: 500;
}

.stock-min-input.form-control {
  width: 2.75rem;
  max-width: 100%;
  padding: 0.15rem 0.25rem;
  font-size: 0.8rem;
  text-align: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: none;
}

.stock-min-input.form-control:hover:not(:read-only) {
  border-color: var(--gray-200);
  background: transparent;
}

.stock-min-input.form-control:focus {
  outline: none;
  border-color: var(--red-primary);
  background: transparent;
  box-shadow: none;
}

.stock-min-input.form-control:read-only {
  color: var(--gray-400);
  cursor: default;
}

.form-group__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.form-group__header-row label {
  margin-bottom: 0;
}

.price-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.price-tier-row {
  display: grid;
  grid-template-columns: 5rem 5rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.price-tier-row label {
  font-size: 0.72rem;
  color: var(--gray-400);
  margin-bottom: 0.15rem;
  display: block;
}

.price-tier-field {
  min-width: 0;
}

.price-tiers-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--gray-400);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--charcoal);
}

.form-group label .required { color: var(--red-primary); }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

.form-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--gray-400);
  line-height: 1.45;
}

/* ===== Tela: Conexão com Banco de Dados ===== */
.db-status {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--gray-400);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.db-status__dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: var(--gray-400);
  box-shadow: 0 0 0 4px rgba(153, 153, 153, 0.15);
}

.db-status__label {
  display: block;
  font-family: var(--font-title);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 0.2rem;
}

.db-status__text {
  font-size: 0.875rem;
  color: var(--charcoal);
  line-height: 1.45;
}

.db-status[data-state="postgres"] {
  border-left-color: #15803d;
}
.db-status[data-state="postgres"] .db-status__dot {
  background: #15803d;
  box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.15);
}

.db-status[data-state="ready"] {
  border-left-color: var(--red-secondary);
}
.db-status[data-state="ready"] .db-status__dot {
  background: var(--red-secondary);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.18);
}

.db-status[data-state="fallback"] {
  border-left-color: var(--red-primary);
}
.db-status[data-state="fallback"] .db-status__dot {
  background: var(--red-primary);
  box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.18);
}

.db-step {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.db-step.is-disabled {
  opacity: 0.6;
}

.db-step__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.db-step__num {
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--red-primary);
  color: var(--white);
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 500;
}

.db-step.is-disabled .db-step__num {
  background: var(--gray-400);
}

.db-step__title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.db-step__desc {
  font-size: 0.8125rem;
  color: var(--gray-400);
  line-height: 1.5;
  margin: 0;
}

.db-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.db-form__col-2 {
  grid-column: span 2;
}

@media (max-width: 640px) {
  .db-form__grid { grid-template-columns: 1fr; }
  .db-form__col-2 { grid-column: span 1; }
}

.db-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.35rem;
}

.db-checklist-wrap {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
}

.db-checklist-wrap__label,
.db-result__label {
  display: block;
  font-family: var(--font-title);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
}

.db-result {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.db-danger {
  border: 1px solid rgba(229, 57, 53, 0.25);
}

.db-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-400);
  vertical-align: middle;
}

.db-reset-blocked {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  background: rgba(229, 57, 53, 0.08);
  color: #7f1d1d;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.db-step__num--danger {
  background: var(--red-primary);
}

.db-danger__confirm {
  max-width: 320px;
  margin-bottom: 0.5rem;
}

.db-danger__confirm label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--charcoal);
}

.btn--danger-solid {
  background: var(--red-primary);
  color: var(--white);
  font-size: var(--font-sm);
  padding: 0.55rem 1.15rem;
}

.btn--danger-solid:hover:not(:disabled) {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

.migration-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.migration-checklist__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  border-radius: var(--radius);
  background: var(--gray-100);
  animation: migration-checklist-in 0.25s ease;
}

.migration-checklist__icon {
  flex: 0 0 1.35rem;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
}

.migration-checklist__item--created {
  background: rgba(21, 128, 61, 0.08);
  color: #14532d;
}
.migration-checklist__item--created .migration-checklist__icon {
  background: #15803d;
}

.migration-checklist__item--exists_ok {
  background: var(--gray-100);
  color: var(--charcoal);
}
.migration-checklist__item--exists_ok .migration-checklist__icon {
  background: var(--gray-400);
}

.migration-checklist__item--error {
  background: rgba(229, 57, 53, 0.08);
  color: #7f1d1d;
}
.migration-checklist__item--error .migration-checklist__icon {
  background: var(--red-primary);
}

@keyframes migration-checklist-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-result {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--gray-100);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--font-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}

.form-control:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(229,57,53,0.12);
}

.form-control.error { border-color: var(--red-primary); }

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 2.75rem;
}

.password-field__toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  cursor: pointer;
  opacity: 0.5;
  z-index: 2;
  user-select: none;
  transition: opacity var(--transition), color var(--transition);
}

.password-field__toggle:hover,
.password-field__toggle:focus-visible {
  opacity: 0.9;
  color: var(--charcoal);
  outline: none;
}

.password-field__toggle svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.password-field__toggle.is-visible svg {
  opacity: 0.75;
}

.form-error {
  font-size: 0.75rem;
  color: var(--red-primary);
  margin-top: 0.3rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row > .form-group {
  min-width: 0;
}

select.form-control,
.form-control--select {
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  padding-right: 2.25rem;
  appearance: auto;
  -webkit-appearance: menulist;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.42rem 0.8rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-title);
  font-size: var(--font-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn--primary,
.btn--highlight {
  font-size: var(--font-sm);
  padding: 0.55rem 1.15rem;
}

.btn--primary {
  background: var(--red-primary);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(229,57,53,0.3);
}

.btn--secondary {
  background: var(--gray-200);
  color: var(--charcoal);
}

.btn--secondary:hover { background: #ddd; }

.btn--sidebar {
  background: var(--charcoal);
  color: var(--white);
}

.btn--sidebar:hover {
  background: #444444;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(51, 51, 51, 0.25);
}

.btn--outline {
  background: transparent;
  border: 1.5px solid var(--red-primary);
  color: var(--red-primary);
}

.btn--outline:hover {
  background: var(--red-primary);
  color: var(--white);
}

.btn--danger {
  background: transparent;
  color: var(--red-primary);
  padding: 0.4rem;
}

.btn--danger:hover { background: rgba(229,57,53,0.1); }

.btn--lg {
  padding: 0.65rem 1.25rem;
  font-size: var(--font-sm);
}

.btn--highlight {
  background: linear-gradient(135deg, var(--red-primary), var(--red-secondary));
  color: white;
  box-shadow: 0 6px 20px rgba(229,57,53,0.35);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(229,57,53,0.35); }
  50% { box-shadow: 0 6px 30px rgba(229,57,53,0.55); }
}

.btn svg { width: 14px; height: 14px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Table */
.table-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table-toolbar__filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.table-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-toolbar > .btn.btn--sidebar {
  flex-shrink: 0;
}

.table-toolbar__filters select.form-control,
.table-toolbar__actions select.form-control,
.table-toolbar__actions .form-control--select {
  width: auto;
  min-width: 0;
  max-width: 160px;
  padding: 0.32rem 1.75rem 0.32rem 0.6rem;
  font-size: 0.8rem;
}

.table-toolbar__filters select.form-control {
  max-width: 130px;
}

.table-toolbar__actions select.form-control,
.table-toolbar__actions .form-control--select {
  max-width: 150px;
}

.period-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.period-filter__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-400);
  white-space: nowrap;
}

.period-filter__sep {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.period-filter__date {
  width: auto;
  min-width: 130px;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
}

.table-toolbar .search-box {
  flex: 1;
  max-width: 320px;
  min-width: 160px;
}

.btn--sm {
  padding: 0.32rem 0.6rem;
  font-size: 0.625rem;
}

/* Collapsible panels (registros de vendas, etc.) */
.collapsible-panel.collapsed .collapsible-panel__body {
  display: none;
}

.collapsible-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-100);
}

.collapsible-panel__title {
  font-family: var(--font-title);
  font-size: 0.9375rem;
  font-weight: 500;
}

.collapsible-panel__toggle {
  border-color: var(--gray-200);
  background: var(--white);
  color: var(--charcoal);
}

.collapsible-panel__toggle:hover {
  background: rgba(247, 232, 225, 0.8);
  border-color: var(--red-primary);
  color: var(--red-primary);
}

.collapsible-panel__chevron {
  transition: transform var(--transition);
}

.collapsible-panel.collapsed .collapsible-panel__chevron {
  transform: rotate(-90deg);
}

.collapsible-panel:not(.collapsed) .collapsible-panel__chevron {
  transform: rotate(0deg);
}

.collapsible-panel.collapsed .collapsible-panel__header {
  border-bottom: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.55rem 0.5rem;
  text-align: left;
  font-size: var(--font-sm);
}

.data-table th {
  background: var(--gray-100);
  font-family: var(--font-title);
  font-weight: 500;
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-400);
}

.data-table--compact th,
.data-table--compact td {
  padding: 0.4rem 0.35rem;
  font-size: var(--font-xs);
  line-height: 1.35;
  vertical-align: middle;
}

.data-table--compact th {
  font-size: 0.625rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.data-table--compact .actions {
  gap: 0.15rem;
}

.data-table--compact .actions button {
  padding: 0.2rem;
}

.data-table--compact .actions button svg {
  width: 13px;
  height: 13px;
}

.cell-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.sales-table {
  table-layout: fixed;
  width: 100%;
}

.sales-table .col-id { width: 2.2rem; }
.sales-table .col-cliente-id { width: 2.4rem; }
.sales-table .col-cliente { width: 9%; }
.sales-table .col-produto { width: 14%; }
.sales-table .col-qtde { width: 2.2rem; }
.sales-table .col-money { width: 4.8rem; }
.sales-table .col-pct { width: 2.8rem; }
.sales-table .col-pagamento { width: 4.2rem; }
.sales-table .col-canal { width: 4.2rem; }
.sales-table .col-data { width: 6.5rem; }
.sales-table .col-ref { width: 3rem; }
.sales-table .col-actions { width: 4.5rem; }

.data-table tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--transition);
}

.data-table tbody tr:hover { background: rgba(247,232,225,0.4); }

.data-table__row--clickable {
  cursor: pointer;
}

.data-table tr.data-table__total-row {
  background: var(--charcoal);
  color: var(--white);
  font-weight: 500;
}

.data-table tr.data-table__total-row:hover {
  background: var(--charcoal);
}

.data-table .actions {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

.data-table .actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  color: var(--gray-400);
  transition: all var(--transition);
}

.data-table .actions button:hover {
  color: var(--red-primary);
  background: rgba(229,57,53,0.08);
}

.data-table .actions.actions--text {
  gap: 0.4rem;
  flex-wrap: wrap;
}

.data-table .actions.actions--text .btn {
  min-width: 4.75rem;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--gray-400);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(51,51,51,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
}

.modal--wide {
  max-width: 920px;
}

.modal--sale {
  max-width: min(980px, 96vw);
}

.perm-intro {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

.perm-intro--info {
  color: var(--charcoal);
  background: var(--cream);
  border: 1px solid var(--peach);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.perm-category {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fafafa;
}

.perm-category__title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
  color: var(--charcoal);
}

.perm-screen {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.perm-screen:last-child {
  margin-bottom: 0;
}

.perm-screen__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.perm-screen__shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0 0.5rem;
  font-size: 0.9rem;
  color: var(--gray-400);
}

.perm-screen__meta {
  font-size: 0.78rem;
  color: var(--gray-400);
}

.perm-screen__actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.perm-action label {
  font-size: 0.82rem;
}

.perm-action .form-group {
  margin-bottom: 0;
}

.perm-action--disabled {
  opacity: 0.45;
}

.perm-action--disabled label {
  color: var(--gray-400);
}

.perm-action--disabled .form-control {
  background: var(--gray-200);
  color: var(--gray-400);
  cursor: not-allowed;
  border-color: var(--gray-200);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal__header h2 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 500;
}

.modal__header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal__close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--gray-400);
  line-height: 1;
}

.modal__body { padding: 1.5rem; }

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  color: white;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  max-width: 360px;
}

.toast--success { background: #2e7d32; }
.toast--error { background: var(--red-primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* Sales cart */
.sale-barcode-row {
  display: grid;
  grid-template-columns: minmax(0, 1.618fr) auto;
  gap: calc(var(--space-phi-sm) / var(--phi));
  align-items: stretch;
}

.sale-barcode-row__field {
  min-width: 0;
}

.btn-bip {
  align-self: stretch;
  flex-shrink: 0;
  padding: 0.55rem 0.85rem;
  min-width: calc(2.5rem * var(--phi));
  font-family: var(--font-title);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--gray-400);
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.btn-bip:hover {
  color: var(--charcoal);
  border-color: #c8c8c8;
  background: #fafafa;
}

.btn-bip.is-active {
  color: var(--red-primary);
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

.sale-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 1.618fr);
  gap: var(--space-phi-lg);
  align-items: start;
}

.cart-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-phi-lg);
  position: sticky;
  top: 2rem;
  min-width: 0;
}

.cart-panel h3 {
  font-family: var(--font-title);
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid var(--red-primary);
}

#cartList {
  min-height: 4.5rem;
  margin-bottom: 0.5rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-phi-sm);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.875rem;
}

.cart-item__info {
  flex: 1;
  min-width: 0;
}

.cart-item__info strong {
  display: block;
  line-height: 1.35;
  word-break: break-word;
}

.cart-item__info small {
  display: block;
  margin-top: 0.2rem;
  color: var(--gray-400);
  line-height: 1.4;
}

.cart-item__meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--gray-400);
}

.cart-item__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
  padding-left: 0.5rem;
}

.cart-item__price {
  font-family: var(--font-title);
  font-weight: 500;
  white-space: nowrap;
}

.cart-item__remove {
  background: none;
  border: none;
  color: var(--red-primary);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.15rem 0.25rem;
}

.cart-totals {
  padding-top: 0.35rem;
}

.cart-totals__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--gray-400);
  margin-top: 0.45rem;
}

.cart-totals__row span:last-child {
  white-space: nowrap;
}

.cart-totals .cart-total {
  margin-top: 0.65rem;
}

.cart-panel .form-group {
  margin-bottom: 1rem;
}

.cart-panel .form-flag {
  margin: 0.85rem 0 1rem;
}

.sale-add-block {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: var(--space-phi-md);
  margin-bottom: var(--space-phi-md);
}

.sale-add-block__row {
  display: grid;
  grid-template-columns: 1fr 1.618fr;
  gap: var(--space-phi-sm);
  align-items: end;
}

.sale-add-block__field {
  margin-bottom: 0;
  min-width: 0;
}

.sale-add-block__qty .form-control {
  text-align: center;
  font-family: var(--font-title);
  font-weight: 500;
}

.sale-add-block__action-label {
  display: block;
  visibility: hidden;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.2;
  user-select: none;
}

.btn--add-cart {
  width: 100%;
  margin: 0;
  padding: 0.55rem 1.15rem;
  line-height: 1.2;
  box-sizing: border-box;
}

.btn--add-cart:hover:not(:disabled) {
  transform: none;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.2);
}

.btn--add-cart:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.sale-add-block__discount {
  margin: var(--space-phi-sm) 0 0;
  padding-top: var(--space-phi-sm);
  border-top: 1px solid var(--gray-200);
  font-size: 0.78rem;
}

.sale-add-block__discount input {
  width: 0.9rem;
  height: 0.9rem;
}

.sale-add-block__hint {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-phi-sm);
  margin-top: var(--space-phi-sm);
  padding-top: var(--space-phi-sm);
}

.sale-add-block__hint:not([hidden]) {
  border-top: 1px dashed var(--gray-200);
}

.sale-add-block__hint-item {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: calc(var(--radius) / var(--phi));
  background: var(--white);
  border: 1px solid var(--gray-200);
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--gray-400);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .sale-add-block__row {
    grid-template-columns: 1fr 1fr;
  }

  .sale-add-block__hint-item {
    white-space: normal;
  }
}

.cart-panel__payment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.cart-panel__payment-row .form-group {
  margin-bottom: 0;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 500;
  margin: 1rem 0 0.75rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--charcoal);
}

.cart-panel__payment {
  margin-bottom: 0.5rem;
}

.cart-panel__payment label {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-bottom: 0.35rem;
}

.form-flag {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0 0.5rem;
  font-size: 0.8rem;
  color: var(--gray-400);
  cursor: pointer;
  user-select: none;
}

.form-flag input {
  margin: 0;
  accent-color: var(--red-primary);
}

.form-flag:hover {
  color: var(--charcoal);
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.autocomplete-list.active { display: block; }

.autocomplete-list li {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background var(--transition);
}

.autocomplete-list li:hover { background: var(--cream); }

.autocomplete-list__empty {
  color: var(--gray-400);
  font-size: 0.8rem;
  cursor: default;
  pointer-events: none;
}

.autocomplete-list__empty:hover { background: transparent; }

.form-group--relative { position: relative; }

/* Reports */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.chart-card h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.chart-card__desc {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin: -0.5rem 0 1rem;
}

.chart-card--compact {
  padding: 1rem 1.25rem;
}

.chart-card--compact h3 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.chart-card--compact .chart-card__desc {
  margin-bottom: 0.65rem;
}

.chart-wrap {
  position: relative;
}

.chart-wrap--compact {
  height: 200px;
}

.chart-expand-btn {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 2;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: rgba(255, 255, 255, 0.78);
  color: var(--gray-400);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.42;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(4px);
}

.chart-wrap:hover .chart-expand-btn,
.chart-expand-btn:focus-visible {
  opacity: 0.92;
}

.chart-expand-btn:hover {
  background: var(--white);
  color: var(--charcoal);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-expand-btn[hidden] {
  display: none;
}

.chart-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1rem;
  background: rgba(51, 51, 51, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.chart-fullscreen-overlay.open {
  opacity: 1;
  visibility: visible;
}

body.chart-fullscreen-open {
  overflow: hidden;
}

.chart-fullscreen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 100%;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chart-fullscreen__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.chart-fullscreen__title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 500;
  color: var(--charcoal);
}

.chart-fullscreen__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-400);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.chart-fullscreen__close:hover {
  background: rgba(229, 57, 53, 0.08);
  color: var(--red-primary);
}

.chart-fullscreen__slot.chart-wrap--fullscreen {
  flex: 1;
  min-height: 0;
  height: auto;
  padding: 1rem 1.1rem 1.15rem;
}

.chart-fullscreen__slot.chart-wrap--fullscreen canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
}

.chart-fullscreen__slot.chart-wrap--with-meta {
  display: flex;
  flex-direction: column;
}

.chart-fullscreen__slot.chart-wrap--with-meta canvas {
  flex: 1;
  min-height: 0;
}

.chart-fullscreen__slot .chart-meta-legend {
  flex-shrink: 0;
  padding-top: 0.75rem;
}

.chart-wrap--with-meta {
  height: auto;
  min-height: 200px;
  padding-bottom: 0.35rem;
}

.chart-wrap--with-meta canvas {
  height: 200px !important;
}

.chart-meta-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  padding: 0.5rem 0.25rem 0;
  font-size: 0.75rem;
  color: var(--gray-400);
}

.chart-meta-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-meta-legend__line {
  display: inline-block;
  width: 1.25rem;
  height: 0;
  border-top: 1px dashed;
  opacity: 0.85;
}

.chart-meta-legend__item--min .chart-meta-legend__line {
  border-color: rgba(251, 140, 0, 0.55);
}

.chart-meta-legend__item--min {
  color: rgba(251, 140, 0, 0.85);
}

.chart-meta-legend__item--target .chart-meta-legend__line {
  border-color: rgba(67, 160, 71, 0.55);
}

.chart-meta-legend__item--target {
  color: rgba(67, 160, 71, 0.85);
}

.report-panel.collapsible-panel .collapsible-panel__body {
  padding: 1rem 1.25rem 1.25rem;
}

.report-panel .chart-card__desc {
  margin: 0 0 0.75rem;
}

.report-table-panel {
  padding: 1rem 1.25rem 1.25rem;
}

.report-table-panel .table-toolbar__title {
  margin-bottom: 0.35rem;
}

.report-table-panel .data-table th:nth-child(3),
.report-table-panel .data-table th:nth-child(4),
.report-table-panel .data-table td:nth-child(3),
.report-table-panel .data-table td:nth-child(4) {
  text-align: right;
}

.report-table-panel .data-table tr.data-table__total-row td:nth-child(3),
.report-table-panel .data-table tr.data-table__total-row td:nth-child(4) {
  font-variant-numeric: tabular-nums;
}

.report-rankings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.report-rankings-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.report-rankings-col .data-table {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
}

.report-rankings__title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0;
  padding: 0 0.15rem;
  color: var(--charcoal);
  line-height: 1.3;
  min-height: 1.3rem;
}

.chart-wrap--stacked {
  position: relative;
  height: 280px;
}

.chart-wrap canvas,
.chart-card canvas {
  transition: filter 0.25s ease;
}

.chart-wrap:hover canvas,
.chart-card:hover canvas {
  filter: drop-shadow(0 4px 14px rgba(229, 57, 53, 0.12));
}

.charts-grid .chart-card {
  margin-bottom: 0;
}

.charts-grid .chart-card--compact {
  height: 100%;
}

@media print {
  .chart-wrap canvas,
  .chart-card canvas {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .chart-card,
  .charts-grid {
    break-inside: avoid;
  }
}

.report-panel {
  margin-bottom: 1.5rem;
}

.report-panel:last-child {
  margin-bottom: 0;
}

.table-toolbar__title {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 500;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-row--inset {
  margin-bottom: 0;
}

.chart-card .stat-box {
  background: var(--gray-100);
  box-shadow: none;
  border: 1px solid var(--gray-200);
}

.stat-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 0;
}

.stat-box__value {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--red-primary);
  line-height: 1.25;
  word-break: break-word;
}

.chart-card .stat-box__value {
  font-size: 1.5rem;
}

.stat-box__label {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.25rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
}

.badge--yes { background: #e8f5e9; color: #2e7d32; }
.badge--no { background: #fce4ec; color: #c62828; }
.badge--ok { background: #e8f5e9; color: #2e7d32; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 999px; }
.badge--muted { background: #f3f4f6; color: #6b7280; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 999px; }

.thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }

.sql-console {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.sql-console__editor label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.sql-console__textarea {
  width: 100%;
  min-height: 220px;
  padding: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.sql-console__textarea:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
}

.sql-console__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.sql-console__hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--gray-400);
}

.sql-console__schema h3 {
  margin-bottom: 0.75rem;
}

.sql-console__schema-list {
  max-height: 360px;
  overflow: auto;
}

.sql-console__table {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.6rem;
}

.sql-console__table summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.sql-console__table ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.sql-console__table li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  padding: 0.2rem 0;
  color: var(--gray-600);
}

.sql-console__table code {
  color: var(--charcoal);
}

.sql-console__results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sql-console__results-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.sql-console__results-header h3 {
  margin: 0;
}

.sql-console__meta {
  font-size: 0.8rem;
  color: var(--gray-400);
}

.barcode-box {
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px dashed var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50, #fafafa);
  text-align: left;
}

.barcode-box__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.barcode-box__code {
  font-family: monospace;
  color: var(--gray-400);
}

.barcode-box__img {
  display: block;
  max-width: 160px;
  height: auto;
  margin: 0 0 0.75rem;
}

.barcode-box__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.actions--with-print {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--charcoal);
  cursor: pointer;
}

.btn-icon:hover {
  background: var(--gray-50, #fafafa);
  border-color: var(--gray-300, #ccc);
}

.sql-console__results-wrap {
  overflow: auto;
}

@media (max-width: 900px) {
  .form-row, .charts-grid, .sale-layout, .stats-row, .sql-console, .report-rankings-grid { grid-template-columns: 1fr; }
}

.page-header__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.report-compare-period {
  font-size: 0.8125rem;
  color: var(--text-muted, #666);
  margin-right: 0.25rem;
  white-space: nowrap;
}

.report-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
}

.report-filters__main {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.report-filters .form-group {
  margin-bottom: 0;
  min-width: 160px;
}

.btn-group {
  display: flex;
  gap: 0.35rem;
}

.report-filter-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: rgba(229, 57, 53, 0.08);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--charcoal);
}

.field-hint {
  font-weight: 400;
  color: var(--gray-400);
  font-size: 0.75rem;
}

.stat-box--wide {
  grid-column: span 1;
}

.stat-box__value--sm {
  font-size: 0.95rem;
}

.stat-box__list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--charcoal);
}

.stat-box__hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--gray-400);
}

.report-panel.is-loading {
  position: relative;
  min-height: 80px;
}

.report-panel.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.03) 25%, rgba(0,0,0,0.06) 50%, rgba(0,0,0,0.03) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.global-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  z-index: 2000;
}

.global-search-overlay.open {
  display: flex;
}

.global-search {
  width: min(560px, 92vw);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  padding: 1rem;
}

.global-search__results {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  max-height: 320px;
  overflow: auto;
}

.global-search__item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.65rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.global-search__item:hover {
  background: var(--gray-50, #fafafa);
}

.global-search__item span {
  font-size: 0.8rem;
  color: var(--gray-400);
}

.global-search__empty {
  padding: 0.75rem 0.5rem;
  color: var(--gray-400);
  font-size: 0.9rem;
}

.global-search__hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--gray-400);
}

.global-search__hint kbd {
  background: var(--gray-100, #f0f0f0);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
}

.pagination-info {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--gray-400);
}

/* Relatório de auditoria */
.audit-panel__filters .form-control:not(.period-filter__date) {
  width: auto;
  min-width: 120px;
  max-width: 180px;
  font-size: 0.8rem;
}

.audit-panel__filters select.form-control {
  max-width: 160px;
}

.audit-panel__toolbar {
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

@media (min-width: 901px) {
  .audit-panel__toolbar {
    flex-direction: row;
    align-items: center;
  }

  .audit-panel__filters {
    justify-content: flex-end;
  }
}

.audit-panel__content {
  padding: 0 1.25rem 1.25rem;
}

.audit-panel__pagination {
  padding-top: 0.75rem;
}

.audit-table {
  min-width: 720px;
}

.audit-table th,
.audit-table td {
  padding: 0.55rem 0.75rem;
}

.audit-table th:first-child,
.audit-table td:first-child {
  padding-left: 0.25rem;
}

.audit-table th:last-child,
.audit-table td:last-child {
  padding-right: 0.25rem;
}

.audit-table td:last-child {
  max-width: 280px;
  word-break: break-word;
}

@media (min-width: 901px) {
  .stats-row--inset {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #dailyClosing.stats-row--inset {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Assistente de instalação (primeiro acesso) */
.wizard-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--cream) 0%, var(--peach) 50%, var(--red-secondary) 100%);
}

.wizard-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 640px;
  animation: slideUp 0.6s var(--transition);
}

.wizard-card__head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.wizard-card__head h1 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--charcoal);
}

.wizard-card__head p {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-top: 0.25rem;
}

.wizard-alert {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: rgba(229, 57, 53, 0.08);
  border: 1px solid rgba(229, 57, 53, 0.25);
  color: var(--charcoal);
  font-size: 0.85rem;
  line-height: 1.55;
}

.wizard-alert ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.wizard-alert li { margin-bottom: 0.25rem; }

.wizard-steps {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  gap: 0.5rem;
}

.wizard-steps__item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--gray-400);
  border-top: 3px solid var(--gray-200);
  padding-top: 0.6rem;
  transition: all var(--transition);
}

.wizard-steps__item span {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--white);
  font-weight: 700;
  font-size: 0.75rem;
}

.wizard-steps__item.is-active {
  color: var(--red-primary);
  border-top-color: var(--red-primary);
}
.wizard-steps__item.is-active span {
  background: var(--red-primary);
}
.wizard-steps__item.is-done {
  color: var(--charcoal);
  border-top-color: #15803d;
}
.wizard-steps__item.is-done span {
  background: #15803d;
}

.wizard-step {
  display: none;
  animation: migration-checklist-in 0.3s ease;
}
.wizard-step.is-active {
  display: block;
}

.wizard-step__title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--charcoal);
}
.wizard-step__desc {
  font-size: 0.82rem;
  color: var(--gray-400);
  margin: 0.25rem 0 1.25rem;
}

.wizard-backends {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.wizard-backend {
  display: flex;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.wizard-backend:has(input:checked) {
  border-color: var(--red-primary);
  background: rgba(229, 57, 53, 0.04);
}
.wizard-backend__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.wizard-backend__body strong { font-size: 0.9rem; }
.wizard-backend__body small { font-size: 0.72rem; color: var(--gray-400); }

.wizard-actions-inline {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.wizard-test-result {
  font-size: 0.8rem;
  color: var(--gray-400);
}
.wizard-test-result.is-ok { color: #15803d; }
.wizard-test-result.is-error { color: var(--red-primary); }

.wizard-logo-preview {
  margin-top: 0.75rem;
}
.wizard-logo-preview img,
.wizard-logo-preview__video {
  max-height: 90px;
  max-width: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 0.4rem;
  background: var(--gray-100);
}
.wizard-logo-preview__video {
  max-height: 120px;
  max-width: 280px;
  display: block;
}

.wizard-colors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.wizard-colors--vertical {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 720px;
}

.wizard-color--detail {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
}

.wizard-color__info {
  flex: 1;
  min-width: 0;
}

.wizard-color__info strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--charcoal);
}

.wizard-color__info p {
  font-size: 0.8rem;
  color: var(--gray-400);
  line-height: 1.5;
  margin: 0;
}

.wizard-color--detail .wizard-color__row {
  flex-shrink: 0;
  align-self: center;
}

@media (max-width: 640px) {
  .wizard-color--detail {
    flex-direction: column;
    align-items: stretch;
  }

  .wizard-color--detail .wizard-color__row {
    align-self: flex-start;
  }
}

.wizard-color label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.wizard-color__row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.wizard-color__row input[type="color"] {
  width: 44px;
  height: 38px;
  flex: 0 0 44px;
  padding: 2px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
}
.wizard-color__row input[type="text"] {
  text-transform: uppercase;
}

.value-icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-50);
}

.value-icon-picker__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.value-icon-picker__item:hover {
  border-color: var(--gray-300);
  color: var(--red-primary, #E53935);
}

.value-icon-picker__item.is-selected {
  border-color: var(--red-primary, #E53935);
  color: var(--red-primary, #E53935);
  background: rgba(229, 57, 53, 0.06);
}

.value-icon-picker__svg,
.value-icon-cell .value-icon-picker__svg {
  width: 24px;
  height: 24px;
  display: block;
}

.value-icon-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--gray-700);
}

.wizard-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}
.wizard-footer #nextBtn {
  margin-left: auto;
}

@media (max-width: 600px) {
  .wizard-card { padding: 1.5rem; }
  .wizard-backends { grid-template-columns: 1fr; }
  .wizard-steps__item { font-size: 0; }
  .wizard-steps__item span { font-size: 0.75rem; }
}

/* ===== Manual do Sistema ===== */
.manual-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}
.manual-toc {
  position: sticky;
  top: 1.5rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow);
}
.manual-toc__title {
  display: block;
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.manual-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}
.manual-toc li { margin: 0; }
.manual-toc a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1.3;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}
.manual-toc a:hover {
  color: var(--red-primary);
  background: var(--gray-100);
}
.manual-toc a.is-active {
  color: var(--red-primary);
  background: rgba(229, 57, 53, 0.08);
  border-left-color: var(--red-primary);
  font-weight: 600;
}
.manual-content {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow);
  max-width: 920px;
}
.manual-section { scroll-margin-top: 1.5rem; }
.manual-section + .manual-section {
  margin-top: 2.5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--gray-200);
}
.manual-content h2 {
  font-family: var(--font-title);
  color: var(--red-dark);
  font-size: 1.45rem;
  margin: 0 0 1rem;
}
.manual-content h3 {
  font-family: var(--font-title);
  color: var(--charcoal);
  font-size: 1.1rem;
  margin: 1.75rem 0 0.6rem;
}
.manual-content p { margin: 0 0 0.9rem; line-height: 1.7; }
.manual-content ul,
.manual-content ol { margin: 0 0 1rem; padding-left: 1.4rem; line-height: 1.7; }
.manual-content li { margin-bottom: 0.35rem; }
.manual-content a {
  color: var(--red-primary);
  text-decoration: underline;
}
.manual-content code {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.85em;
}
.manual-content pre {
  background: var(--charcoal);
  color: #f5f5f5;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 0.5rem 0 1.25rem;
  line-height: 1.55;
}
.manual-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 0.82rem;
  white-space: pre;
}
.manual-content kbd {
  display: inline-block;
  background: var(--charcoal);
  color: var(--white);
  border-radius: 6px;
  padding: 0.1rem 0.5rem;
  font-size: 0.78em;
  font-family: var(--font-body);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.manual-table { margin: 0.5rem 0 1.25rem; }
.manual-note,
.manual-warning {
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
  line-height: 1.6;
  font-size: 0.92rem;
}
.manual-note {
  background: rgba(229, 57, 53, 0.06);
  border-left: 4px solid var(--red-secondary);
}
.manual-warning {
  background: #fff8e1;
  border-left: 4px solid #f0a000;
}
.manual-muted {
  color: var(--gray-400);
  font-size: 0.85rem;
  font-style: italic;
}

@media (max-width: 900px) {
  .manual-layout { grid-template-columns: 1fr; }
  .manual-toc { position: static; }
  .manual-content { padding: 1.5rem; }
}

@media print {
  .sidebar,
  .page-header .btn,
  .manual-toc { display: none !important; }
  .manual-layout { grid-template-columns: 1fr; }
  .manual-content { box-shadow: none; border: none; max-width: none; }
  .main-content { margin: 0; padding: 0; }
}
