:root {
  color-scheme: light;
  --ink: #28252d;
  --muted: #77717d;
  --accent: #8b5cf6;
  --accent-dark: #7041db;
  --surface: #ffffff;
  --background: #e9e0f5;
  --border: #e9e4ef;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(40, 25, 65, .06);
}
.login-panel { width: min(100%, 430px); padding: 34px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #eee7ff;
  color: var(--accent-dark);
  font-weight: 800;
  letter-spacing: -.05em;
}
.brand-mark.small { width: 36px; height: 36px; border-radius: 11px; }
.eyebrow {
  margin: 24px 0 8px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}
h1 { margin: 0 0 10px; font-size: clamp(27px, 5vw, 34px); letter-spacing: -.04em; }
h2 { margin-top: 0; }
.muted { color: var(--muted); line-height: 1.6; }
form { display: grid; gap: 12px; }
label { font-size: 14px; font-weight: 650; margin-top: 7px; }
input:not([type=hidden]) {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input:focus { outline: 2px solid #c4b5fd; border-color: var(--accent); }
button {
  min-height: 46px;
  border: 0;
  border-radius: 11px;
  padding: 11px 16px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
button:hover { background: var(--accent-dark); }
.error {
  border-radius: 10px;
  background: #fff0f0;
  color: #a32929;
  padding: 11px 13px;
  font-size: 14px;
}
.footnote { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 4vw, 48px);
  background: white;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 800; }
.topbar form { display: block; }
.button-secondary { background: #f0ebf7; color: var(--ink); }
.button-secondary:hover { background: #e4dcf0; }
.content { max-width: 1080px; margin: 0 auto; padding: 28px 22px 48px; }
.content .eyebrow { margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 26px 0; }
.stat-card { padding: 22px; background: white; border: 1px solid var(--border); border-radius: 16px; }
.stat-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.stat-card strong { font-size: 32px; letter-spacing: -.04em; }
.next-panel { padding: 24px; line-height: 1.65; }
@media (max-width: 640px) {
  .login-panel { padding: 25px; }
  .stats { grid-template-columns: 1fr; gap: 11px; }
  .stat-card { padding: 18px; }
  .stat-card strong { font-size: 28px; }
}

/* Área de produtos */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-actions form { display: block; }
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 16px;
  border-radius: 11px;
  text-decoration: none;
  font-weight: 750;
}
.form-panel, .list-panel {
  padding: 24px;
  margin-top: 22px;
}
.form-panel { max-width: 760px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-hint {
  margin: 0;
  font-size: 13px;
}
.success {
  margin: 18px 0;
  padding: 12px 15px;
  border-radius: 10px;
  background: #e8f8ed;
  color: #176534;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.product-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.product-table th, .product-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.product-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.table-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 640px) {
  .nav-actions { gap: 6px; }
  .nav-actions .button-link, .nav-actions button {
    padding: 10px 12px;
    font-size: 13px;
  }
  .form-panel, .list-panel { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .product-table th, .product-table td { padding: 12px 9px; }
}

/* Formulário de entrada de mercadorias */
.stock-form {
  display: grid;
  grid-template-columns: minmax(90px, 110px) minmax(140px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 390px;
}
.stock-form input:not([type=hidden]) {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 13px;
}
.stock-form button {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 13px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================================================
   CdebCompany — Painel roxo moderno
   ================================================== */
:root {
  --ink: #241b35;
  --muted: #777087;
  --accent: #8054e9;
  --accent-dark: #693bd1;
  --surface: #ffffff;
  --background: #e9e0f5;
  --border: #e9e3f3;
  --sidebar-bg: #24163b;
  --sidebar-text: #d9d0ec;
  --sidebar-active: #8054e9;
}

body {
  background: var(--background);
  color: var(--ink);
}

.topbar {
  background: var(--surface);
  border-bottom-color: var(--border);
}

.brand-mark {
  background: #eee7ff;
  color: var(--accent-dark);
}

.button-link,
button:not(.button-secondary):not(.sidebar-logout) {
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.button-link:not(.button-secondary) {
  background: var(--accent);
  color: #fff;
}

.button-link:not(.button-secondary):hover {
  background: var(--accent-dark);
  box-shadow: 0 5px 14px rgba(105, 59, 209, .18);
}

.button-secondary {
  background: #f0ebf8;
  color: #35264b;
}

.panel,
.stat-card {
  border-color: var(--border);
  box-shadow: 0 8px 28px rgba(42, 25, 69, .045);
}

.stat-card {
  border-radius: 18px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(42, 25, 69, .08);
}

.stat-card strong {
  color: var(--ink);
}

.eyebrow {
  color: var(--accent-dark);
}

.product-table th {
  background: #faf8fe;
}

.product-table tbody tr:hover {
  background: #faf8fe;
}

input:not([type=hidden]):focus,
select:focus,
textarea:focus {
  outline: 2px solid #cbb8ff;
  outline-offset: 1px;
  border-color: var(--accent);
}

/* Menu lateral compartilhado */
.app-layout {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: 258px;
  padding: 24px 16px;
  overflow-y: auto;
  background: var(--sidebar-bg);
  color: #fff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 28px;
  color: #fff;
  text-decoration: none;
}

.sidebar-brand .brand-mark {
  flex: 0 0 auto;
  background: #a78bfa;
  color: #24163b;
}

.sidebar-brand-text {
  display: grid;
  gap: 4px;
}

.sidebar-brand-text strong {
  font-size: 15px;
  letter-spacing: -.02em;
}

.sidebar-brand-text small {
  color: #bdb0d5;
  font-size: 12px;
}

.sidebar-label {
  margin: 8px 10px 12px;
  color: #a99abd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-link,
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--sidebar-text);
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.sidebar-link.is-active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .14);
}

.sidebar-icon {
  display: inline-grid;
  flex: 0 0 22px;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
}

.sidebar-footer form {
  display: block;
}

.sidebar-logout {
  cursor: pointer;
}

.sidebar-logout:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  margin-left: 258px;
}

.app-main .content {
  max-width: 1440px;
  padding: 34px clamp(20px, 3vw, 44px) 52px;
}

.app-page-heading {
  margin-bottom: 28px;
}

.app-page-heading h1 {
  margin-bottom: 8px;
}

.app-page-heading .eyebrow {
  margin-top: 0;
}

@media (max-width: 760px) {
  .sidebar {
    position: relative;
    inset: auto;
    width: 100%;
    padding: 14px 14px 12px;
    overflow: visible;
  }

  .sidebar-brand {
    padding: 2px 4px 14px;
  }

  .sidebar-label {
    margin: 4px 6px 8px;
  }

  .sidebar-nav {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .sidebar-link {
    flex: 0 0 auto;
    width: auto;
    min-height: 42px;
    padding: 9px 11px;
    white-space: nowrap;
  }

  .sidebar-icon {
    flex-basis: auto;
    font-size: 17px;
  }

  .sidebar-footer {
    padding-top: 8px;
  }

  .sidebar-logout {
    min-height: 40px;
  }

  .app-main {
    margin-left: 0;
  }

  .app-main .content {
    padding: 24px 16px 36px;
  }
}

/* CdebCompany — acabamento dos cartões do painel */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.dashboard-grid .stat-card {
  position: relative;
  min-width: 0;
  padding: 24px;
  overflow: hidden;
  border: 1px solid #e9e3f3;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #fcfaff 100%);
  box-shadow: 0 8px 24px rgba(42, 25, 69, .045);
  transition: transform .18s ease, box-shadow .18s ease;
}

.dashboard-grid .stat-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #a78bfa, #8054e9);
  content: "";
}

.dashboard-grid .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 32px rgba(64, 38, 105, .09);
}

.dashboard-grid .stat-card p {
  margin: 0 0 15px;
  color: #777087;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.dashboard-grid .stat-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: #2d2042;
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.dashboard-grid .stat-card .table-subtitle {
  margin-top: 12px;
  color: #898198;
  font-size: 12px;
  line-height: 1.5;
}

.dashboard-grid + .panel {
  margin-top: 30px;
}

.app-main .next-panel {
  padding: 26px;
  border-radius: 18px;
}

.app-main .next-panel h2 {
  margin-bottom: 8px;
  color: #2d2042;
  font-size: 19px;
}

.app-main .next-panel > p {
  color: #777087;
}

@media (max-width: 1050px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 520px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 22px 0;
  }

  .dashboard-grid .stat-card {
    padding: 21px;
  }

  .app-main .next-panel {
    padding: 20px;
  }
}

/* Logo original CdebCompany */
.sidebar-brand {
  justify-content: center;
}

.sidebar-logo {
  display: block;
  width: 100%;
  max-width: 190px;
  max-height: 105px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

/* Logo CdebCompany centralizada no topo das páginas */
.app-top-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 18px 24px 0;
}

.app-top-logo img {
  display: block;
  width: min(240px, 60vw);
  max-height: 120px;
  height: auto;
  object-fit: contain;
}

@media (max-width: 700px) {
  .app-top-logo {
    padding: 14px 16px 0;
  }

  .app-top-logo img {
    width: min(200px, 65vw);
    max-height: 100px;
  }
}

.app-top-logo {
  flex-direction: column;
  gap: 5px;
  padding-bottom: 8px;
}

.app-top-logo-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.app-top-logo-text strong {
  color: #2d2042;
  font-size: 18px;
  font-weight: 800;
}

.app-top-logo-text span {
  color: #777087;
  font-size: 12px;
}

/* CdebCompany — redesign profissional do painel */
.dashboard-page {
  color: #29213b;
}

.dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 8px 0 34px;
}

.dashboard-heading h1 {
  margin: 0 0 8px;
  color: #2d2042;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.15;
}

.dashboard-heading .eyebrow {
  margin: 0 0 12px;
  color: #7855d9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
}

.dashboard-heading .muted {
  margin: 0;
  font-size: 14px;
}

.dashboard-primary-action {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 7px 18px rgba(109, 74, 255, .2);
  font-weight: 750;
}

.dashboard-section {
  margin: 0 0 32px;
}

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

.dashboard-section-heading h2 {
  margin: 0 0 5px;
  color: #302442;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.025em;
}

.dashboard-section-heading p {
  margin: 0;
  color: #81788f;
  font-size: 13px;
  line-height: 1.55;
}

.dashboard-page .dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.dashboard-page .dashboard-grid .stat-card {
  min-height: 156px;
  padding: 22px 24px;
  border: 1px solid #ebe6f3;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(45, 32, 66, .035);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.dashboard-page .dashboard-grid .stat-card::before {
  width: 3px;
  background: #c8b7ff;
}

.dashboard-page .dashboard-grid .stat-card:hover {
  transform: translateY(-2px);
  border-color: #d9cdfa;
  box-shadow: 0 12px 26px rgba(45, 32, 66, .075);
}

.dashboard-page .stat-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}

.dashboard-page .stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #f0ebff;
  color: #7050d5;
  font-size: 18px;
  font-weight: 800;
}

.dashboard-page .stat-label {
  color: #777087;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.dashboard-page .dashboard-grid .stat-card strong {
  color: #2d2042;
  font-size: clamp(25px, 2.3vw, 32px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.dashboard-page .dashboard-grid .stat-card .table-subtitle {
  display: block;
  margin-top: 9px;
  color: #8a8297;
  font-size: 12px;
  line-height: 1.5;
}

.dashboard-page .stat-card-revenue {
  background: linear-gradient(135deg, #fff 35%, #f7f3ff 100%) !important;
}

.dashboard-page .stat-card-revenue::before {
  background: #8054e9 !important;
}

.dashboard-page .stat-card-revenue .stat-icon {
  background: #ebe3ff;
  color: #6841d9;
}

.dashboard-page .stat-card-profit::before {
  background: #39a879 !important;
}

.dashboard-page .stat-card-profit .stat-icon {
  background: #e7f7ef;
  color: #23865c;
}

.dashboard-page .stat-card-cost .stat-icon {
  background: #fff2df;
  color: #a96a19;
}

.dashboard-page .stat-card-expenses .stat-icon {
  background: #ffeded;
  color: #bd5353;
}

.dashboard-page .dashboard-grid-stock .stat-card {
  min-height: 145px;
}

.dashboard-page .stat-card-products .stat-icon,
.dashboard-page .stat-card-units .stat-icon {
  background: #eaf1ff;
  color: #426fbd;
}

.dashboard-page .stat-card-alert {
  background: #fffaf2 !important;
  border-color: #f2e1c3 !important;
}

.dashboard-page .stat-card-alert::before {
  background: #e5a13b !important;
}

.dashboard-page .stat-card-alert .stat-icon {
  background: #ffedcf;
  color: #a66a12;
}

.dashboard-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.quick-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 19px 16px;
  border: 1px solid #e9e3f3;
  border-radius: 16px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 5px 18px rgba(45, 32, 66, .035);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  border-color: #d6c8fa;
  box-shadow: 0 10px 24px rgba(45, 32, 66, .07);
}

.quick-action-primary {
  border-color: #e2d7ff;
  background: linear-gradient(135deg, #f8f5ff, #fff);
}

.quick-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #eee8ff;
  color: #704bd8;
  font-size: 21px;
  font-weight: 700;
}

.quick-action-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.quick-action-copy strong {
  color: #302442;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.quick-action-copy span {
  color: #837a91;
  font-size: 11px;
  line-height: 1.45;
}

.quick-action-arrow {
  flex: 0 0 auto;
  color: #8a70d7;
  font-size: 18px;
}

@media (min-width: 1100px) {
  .dashboard-page .dashboard-grid:not(.dashboard-grid-stock) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-page .dashboard-grid-stock {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 28px;
  }

  .dashboard-primary-action {
    width: 100%;
  }

  .dashboard-quick-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quick-action-card {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .dashboard-page .dashboard-grid,
  .dashboard-page .dashboard-grid:not(.dashboard-grid-stock),
  .dashboard-page .dashboard-grid-stock {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dashboard-page .dashboard-grid .stat-card {
    min-height: auto;
    padding: 20px;
  }

  .dashboard-section {
    margin-bottom: 27px;
  }

  .dashboard-section-heading h2 {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-page .dashboard-grid .stat-card,
  .quick-action-card {
    transition: none;
  }
}

/* CdebCompany — melhoria visual exclusiva do PDV */
.app-main .content:has(#sale-form) {
  max-width: 1180px;
}

.app-main .content:has(#sale-form) > h1 {
  margin-bottom: 8px;
  letter-spacing: -0.035em;
}

.app-main .content:has(#sale-form) > .muted {
  line-height: 1.6;
}

#sale-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#sale-form > #sale-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#sale-form .sale-item {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(110px, 0.65fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

#sale-form .sale-item label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

#sale-form .sale-product {
  grid-column: 1;
}

#sale-form .sale-quantity {
  grid-column: 2;
}

#sale-form .remove-item {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
}

#sale-form input:not([type="hidden"]),
#sale-form select {
  width: 100%;
  min-height: 46px;
  border-radius: 10px;
}

#sale-form #add-item {
  align-self: flex-start;
  min-height: 42px;
}

#sale-form .sale-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f5f1ff;
  color: #35264b;
}

#sale-form .sale-total span {
  font-size: 15px;
  font-weight: 700;
}

#sale-form .sale-total strong {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 850;
  letter-spacing: -0.04em;
}

#sale-form > label {
  margin-top: 5px;
  font-weight: 700;
}

#sale-form #change-box {
  margin: 0;
  padding: 16px;
  border-radius: 12px;
}

#sale-form .form-hint {
  line-height: 1.6;
}

#sale-form > button[type="submit"] {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
  font-weight: 800;
}

@media (max-width: 700px) {
  .app-main .content:has(#sale-form) {
    padding-right: 14px;
    padding-left: 14px;
  }

  #sale-form .sale-item {
    grid-template-columns: minmax(0, 1fr) minmax(90px, 0.5fr);
    padding: 14px;
    gap: 10px;
  }

  #sale-form .sale-item label:first-child,
  #sale-form .sale-product {
    grid-column: 1 / -1;
  }

  #sale-form .sale-quantity {
    grid-column: 1;
  }

  #sale-form .remove-item {
    grid-column: 2;
    grid-row: auto;
    justify-self: stretch;
    align-self: end;
    min-height: 44px;
  }

  #sale-form .sale-total {
    padding: 18px 14px;
  }
}


/* CdebCompany — identidade visual do painel principal */
.dashboard-page {
  background: #f5f1fa;
  border-radius: 22px;
  padding: 28px;
}

.dashboard-page .dashboard-heading {
  background: linear-gradient(135deg, #eee5fb 0%, #faf7ff 68%, #f8f0d9 100%);
  border: 1px solid #e5d8f5;
  border-radius: 20px;
  padding: 26px;
  margin-bottom: 28px;
}

.dashboard-page .eyebrow {
  color: #7952bd;
}

.dashboard-page .dashboard-section-heading h2,
.dashboard-page h1 {
  color: #30213f;
}

.dashboard-page .dashboard-section-heading p,
.dashboard-page .muted {
  color: #766b83;
}

.dashboard-page .dashboard-grid .stat-card {
  background: #fff;
  border-color: #e8dff1;
  box-shadow: 0 8px 24px rgba(68, 43, 94, 0.06);
}

.dashboard-page .stat-card-revenue::before,
.dashboard-page .stat-card-profit::before {
  background: #8054e9;
}

.dashboard-page .stat-card-revenue .stat-icon,
.dashboard-page .stat-card-products .stat-icon {
  background: #eee5ff;
  color: #7045c5;
}

.dashboard-page .stat-card-profit .stat-icon,
.dashboard-page .stat-card-units .stat-icon {
  background: #f8efd2;
  color: #98751b;
}

.dashboard-page .stat-card-cost .stat-icon {
  background: #e8e1f5;
  color: #674c91;
}

.dashboard-page .stat-card-expenses .stat-icon {
  background: #f8e6e6;
  color: #a34d57;
}

.dashboard-page .stat-card-alert {
  background: #fffaf0 !important;
  border-color: #f0dfb5 !important;
}

.dashboard-page .stat-card-alert .stat-icon {
  background: #f8edcf;
  color: #98751b;
}

.dashboard-page .dashboard-quick-actions .quick-action-card {
  background: #fff;
  border-color: #e8dff1;
}

.dashboard-page .dashboard-quick-actions .quick-action-primary {
  background: #eee5ff;
  border-color: #ddcdf7;
}

@media (max-width: 700px) {
  .dashboard-page {
    padding: 16px;
    border-radius: 16px;
  }

  .dashboard-page .dashboard-heading {
    padding: 18px;
    border-radius: 16px;
  }
}


/* Fotos dos produtos no cadastro e no PDV */
.product-thumbnail {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 8px;
}

#sale-form .sale-product-image {
  grid-column: 1;
  width: 76px;
  height: 76px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 4px;
}

#sale-form .sale-product-image[hidden] {
  display: none;
}

#product-image-preview:not([hidden]) {
  display: block;
  margin-top: 8px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 4px;
}

/* Ajustes responsivos para fotos de produtos */
#product-image-preview {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 220px;
  object-fit: contain;
}

.product-thumbnail {
  max-width: 100%;
  height: 64px;
  object-fit: contain;
}

#sale-form .sale-product-image {
  display: block;
  max-width: 100%;
  width: 76px;
  height: 76px;
  object-fit: contain;
}

@media (max-width: 640px) {
  #product-image-preview:not([hidden]) {
    width: auto;
    max-width: min(100%, 180px);
    max-height: 180px;
  }

  #sale-form .sale-product-image:not([hidden]) {
    width: 56px;
    height: 56px;
    padding: 2px;
  }

  .product-thumbnail {
    width: 48px;
    height: 48px;
    padding: 2px;
  }

  #sale-form,
  #sale-form * {
    min-width: 0;
  }
}

/* Editor de recorte quadrado das fotos dos produtos */
.crop-editor {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface, #fff);
  max-width: 100%;
  box-sizing: border-box;
}

.crop-editor[hidden] {
  display: none !important;
}

.crop-editor h3 {
  margin-top: 0;
}

.crop-viewport {
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  margin: 12px auto;
  overflow: hidden;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 8px;
  touch-action: none;
}

#crop-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#crop-canvas:active {
  cursor: grabbing;
}

#crop-zoom {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 8px 0 16px;
}

.crop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.crop-actions button {
  min-width: 0;
}

@media (max-width: 640px) {
  .crop-editor {
    padding: 12px;
  }

  .crop-viewport {
    width: min(100%, 280px);
  }

  .crop-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .crop-actions button {
    width: 100%;
  }
}
