:root {
  --ink: #13233a;
  --muted: #607086;
  --blue: #2563eb;
  --blue-dark: #1747b0;
  --cyan: #dff5ff;
  --paper: #f5f8fc;
  --white: #fff;
  --line: #dfe7f1;
  --green: #157347;
  --amber: #9a6100;
  --red: #b42318;
  --shadow: 0 14px 40px rgba(28, 56, 96, 0.12);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  line-height: 1.6;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 6vw, 88px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
}
.brand img {
  width: 38px;
}
.main-nav {
  display: flex;
  gap: 8px;
}
.main-nav a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  transition: 0.25s;
}
.main-nav a:hover,
.main-nav a.active {
  background: var(--cyan);
  color: var(--blue-dark);
  transform: translateY(-2px);
}
.menu-button {
  display: none;
  border: 0;
  background: var(--cyan);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 1.2rem;
}
.hero {
  min-height: 600px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
  padding: 72px clamp(20px, 7vw, 100px);
  background: linear-gradient(135deg, #fff 0%, #eaf6ff 70%, #d7f0ff 100%);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(2.5rem, 6vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin-bottom: 22px;
}
h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}
.hero p:not(.eyebrow) {
  max-width: 640px;
  font-size: 1.12rem;
  color: var(--muted);
}
.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--blue);
}
.hero-image {
  filter: drop-shadow(0 24px 28px rgba(22, 71, 176, 0.2));
  animation: float 5s ease-in-out infinite;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 12px 19px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s;
}
.button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}
.primary {
  background: var(--blue);
  color: #fff;
}
.primary:hover {
  background: var(--blue-dark);
}
.secondary {
  background: #fff;
  border: 1px solid var(--line);
}
.section,
.page-main {
  padding: 64px clamp(20px, 7vw, 100px);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}
.status {
  color: var(--green);
  font-size: 0.88rem;
  font-weight: 700;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: 0.25s;
}
.stat-card:hover {
  transform: translateY(-6px);
}
.stat-card strong {
  display: block;
  font-size: 1.65rem;
  margin: 18px 0 4px;
}
.stat-card p {
  margin: 0;
  color: var(--muted);
}
.icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--cyan);
  color: var(--blue-dark);
  font-weight: 800;
}
.warning .icon {
  background: #fff1cf;
  color: var(--amber);
}
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  background: #13233a;
  color: #fff;
}
.features article {
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
}
.features span {
  color: #7dd3fc;
  font-weight: 800;
}
.features p {
  color: #c7d3e0;
}
.media-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 42px;
  align-items: center;
}
.media-section video {
  width: 100%;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
audio {
  width: 100%;
  margin-top: 18px;
}
.page-main {
  min-height: 70vh;
}
.page-title {
  max-width: 760px;
  margin: 30px 0 42px;
}
.page-title h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
}
.toolbar {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar label {
  display: grid;
  gap: 6px;
  flex: 1;
  min-width: 230px;
  font-weight: 700;
}
.toolbar input,
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd8e6;
  border-radius: 11px;
  padding: 12px 14px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.table-card,
form,
.contact-copy {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
th,
td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  background: #eef5ff;
  color: var(--blue-dark);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tbody tr {
  transition: 0.2s;
}
tbody tr:hover {
  background: #f7fbff;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}
.ok {
  background: #def7e9;
  color: var(--green);
}
.low {
  background: #fff1cf;
  color: var(--amber);
}
.out {
  background: #ffe2df;
  color: var(--red);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 20px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}
.product-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}
.product-grid img {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 12px;
}
.product-grid h3 {
  margin: 14px 0 3px;
}
.product-grid p {
  color: var(--muted);
  margin: 0;
}
.contact-layout {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 24px;
}
.contact-copy {
  align-self: start;
}
.note {
  margin-top: 28px;
  color: var(--muted);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}
.full {
  grid-column: 1/-1;
}
.check {
  display: flex;
  gap: 10px;
  align-items: start;
  margin: 18px 0;
}
.check input {
  width: auto;
  margin-top: 6px;
}
.form-result {
  margin: 14px 0 0;
  color: var(--green);
  font-weight: 700;
}
footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 36px clamp(20px, 7vw, 100px);
  background: #0d192b;
  color: #fff;
}
footer p,
footer small {
  color: #aebdce;
}
footer div:nth-child(2) {
  display: flex;
  gap: 20px;
}
footer small {
  grid-column: 1/-1;
  border-top: 1px solid #2d3c51;
  padding-top: 18px;
}
@keyframes float {
  50% {
    transform: translateY(-14px);
  }
}
@media (max-width: 900px) {
  .hero,
  .media-section,
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .features,
  .product-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-top: 50px;
  }
  .hero-image {
    max-height: 390px;
    margin: auto;
  }
  .media-section video {
    order: -1;
  }
}
@media (max-width: 620px) {
  .menu-button {
    display: block;
  }
  .main-nav {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
  }
  .main-nav.open {
    display: flex;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .section-heading {
    align-items: start;
    flex-direction: column;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  footer {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: auto;
  }
  h1 {
    font-size: 2.7rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

/* Continuación visual de las maquetas del Avance 1 */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d192b 0 52%, #eef6ff 52%);
  display: grid;
  place-items: center;
  padding: 28px;
}
.login-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(8, 25, 50, 0.25);
}
.login-brand {
  padding: 70px;
  background: #13233a;
  color: #fff;
}
.login-brand img {
  width: 64px;
  margin-bottom: 42px;
}
.login-brand h1 {
  font-size: 3.8rem;
  margin-bottom: 20px;
}
.login-brand > p:not(.eyebrow),
.login-brand li {
  color: #c7d3e0;
}
.login-brand ul {
  padding-left: 20px;
}
.login-card {
  padding: 70px 58px;
  align-self: center;
}
.login-card form {
  padding: 0;
  border: 0;
  box-shadow: none;
}
.login-card label {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  font-weight: 700;
}
.login-card .button {
  width: 100%;
  margin: 10px 0 20px;
}
.login-card small {
  color: var(--muted);
}
.app-body {
  min-height: 100vh;
  padding-left: 248px;
  background: #f3f6fa;
}
.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  width: 248px;
  background: #13233a;
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
}
.brand-light {
  padding: 0 10px 30px;
}
.sidebar nav {
  display: grid;
  gap: 7px;
}
.sidebar nav a,
.logout {
  padding: 12px 14px;
  border-radius: 11px;
  color: #c7d3e0;
  font-weight: 600;
  transition: 0.2s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: #2563eb;
  color: #fff;
  transform: translateX(3px);
}
.logout {
  margin-top: auto;
  border: 1px solid #31425a;
}
.app-top {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.app-top > div {
  display: grid;
}
.app-top small {
  color: var(--muted);
}
.user-chip {
  background: var(--cyan);
  color: var(--blue-dark);
  padding: 8px 13px;
  border-radius: 999px;
  font-weight: 700;
}
.app-main {
  padding: 38px;
  max-width: 1500px;
  margin: auto;
}
.welcome {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.welcome h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  margin-bottom: 10px;
}
.welcome p:last-child {
  color: var(--muted);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  margin-top: 22px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-title a {
  color: var(--blue);
  font-weight: 700;
}
.movement {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 15px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.movement span {
  color: var(--muted);
}
.movement em {
  font-style: normal;
  font-weight: 700;
}
.negative {
  color: var(--red);
}
.positive {
  color: var(--green);
}
.bar {
  display: grid;
  grid-template-columns: 90px 1fr 35px;
  gap: 12px;
  align-items: center;
  margin: 22px 0;
}
.bar i {
  height: 12px;
  background: linear-gradient(90deg, var(--blue) var(--value), #e7edf5 var(--value));
  border-radius: 99px;
}
.filter {
  max-width: 230px;
}
.sale-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 22px;
}
.inline-control {
  display: flex;
  gap: 12px;
  margin: 8px 0 24px;
}
.sale-summary {
  align-self: start;
  background: #13233a;
  color: #fff;
  border-radius: 20px;
  padding: 25px;
}
.sale-summary p {
  display: flex;
  justify-content: space-between;
}
.sale-summary .total {
  border-top: 1px solid #445269;
  padding-top: 18px;
  font-size: 1.2rem;
}
.sale-summary .button {
  width: 100%;
  margin-top: 10px;
}
.media-panel {
  display: grid;
  gap: 14px;
}
.media-panel img {
  max-height: 220px;
  margin: auto;
}
.media-panel video {
  width: 100%;
  border-radius: 12px;
}
.anchor-panel {
  margin-top: 22px;
  scroll-margin-top: 20px;
}
@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-brand {
    padding: 44px;
  }
  .login-brand h1 {
    font-size: 3rem;
  }
  .app-body {
    padding-left: 0;
  }
  .sidebar {
    transform: translateX(-105%);
    transition: 0.25s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .app-top .menu-button {
    display: block;
  }
  .dashboard-grid,
  .sale-layout {
    grid-template-columns: 1fr;
  }
  .app-main {
    padding: 26px;
  }
  .welcome {
    align-items: start;
    flex-direction: column;
  }
}
@media (max-width: 620px) {
  .login-page {
    padding: 12px;
  }
  .login-brand,
  .login-card {
    padding: 34px 26px;
  }
  .login-brand h1 {
    font-size: 2.45rem;
  }
  .app-top {
    padding: 0 18px;
  }
  .app-main {
    padding: 20px;
  }
  .welcome h1 {
    font-size: 2.25rem;
  }
  .movement {
    grid-template-columns: 55px 1fr;
  }
  .movement em {
    grid-column: 2;
  }
  .inline-control {
    flex-direction: column;
  }
}

/* NovaStock: refinamiento visual de la interfaz operativa */
:root {
  --ink: #192a43;
  --muted: #6d7c91;
  --blue: #2864e8;
  --blue-dark: #1749b8;
  --paper: #f4f7fb;
  --line: #e4eaf2;
  --shadow: 0 10px 30px rgba(28, 49, 85, 0.06);
}
body {
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  letter-spacing: -0.01em;
}
.app-body {
  background: #f5f7fb;
  padding-left: 256px;
}
.sidebar {
  width: 256px;
  padding: 28px 18px;
  background: linear-gradient(180deg, #122744, #102037 100%);
  box-shadow: 4px 0 24px rgba(20, 40, 70, 0.08);
}
.brand-light {
  gap: 12px;
  padding: 0 10px 34px;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}
.brand-light img {
  width: 40px;
}
.brand-light span {
  display: grid;
  line-height: 1.1;
}
.brand-light small {
  margin-top: 6px;
  color: #8fa6c3;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.nav-caption {
  padding: 0 14px 12px;
  color: #8196b0;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.sidebar nav {
  gap: 6px;
}
.sidebar nav a {
  position: relative;
  padding: 12px 16px;
  color: #b7c6d9;
  font-size: 0.91rem;
}
.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: none;
}
.sidebar nav a.active {
  background: #2c65e8;
  color: white;
  box-shadow: 0 7px 16px rgba(22, 82, 215, 0.25);
}
.logout {
  width: 100%;
  background: transparent;
  color: #dce7f4;
  border: 1px solid #3b506b;
  box-shadow: none;
}
.logout:hover {
  background: #243b59;
  transform: none;
  color: white;
}
.app-top {
  height: 78px;
  padding: 0 40px;
  border-color: #e8edf4;
}
.app-top strong {
  font-size: 0.93rem;
}
.app-top small {
  font-size: 0.75rem;
}
.user-chip {
  padding: 8px 13px;
  background: #edf3ff;
  border: 1px solid #e3ebfb;
  font-size: 0.78rem;
}
.app-main {
  padding: 40px;
  max-width: 1500px;
}
.welcome {
  align-items: center;
  margin-bottom: 28px;
}
.welcome h1 {
  font-size: clamp(1.85rem, 3vw, 2.6rem);
  letter-spacing: -0.04em;
  margin: 0 0 8px;
}
.welcome p:last-child {
  margin: 0;
  font-size: 0.94rem;
}
.welcome .eyebrow,
.panel .eyebrow {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  margin-bottom: 9px;
}
.button {
  border-radius: 10px;
  padding: 11px 17px;
  font-size: 0.88rem;
  transition:
    background 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
}
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.button.primary {
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.16);
}
.button:hover {
  transform: translateY(-1px);
}
.stats-grid {
  gap: 16px;
}
.stat-card {
  min-height: 170px;
  padding: 20px 22px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: relative;
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 11px;
  background: #eaf1ff;
  color: #2a63e8;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 15px;
}
.stat-operations .stat-icon {
  background: #eaf9f6;
  color: #159a83;
}
.warning .stat-icon {
  background: #fff3dc;
  color: #c27e10;
}
.stat-products .stat-icon {
  background: #f1eefe;
  color: #7c5bd6;
}
.stat-card .stat-label {
  display: block;
  color: #66758a;
  font-size: 0.79rem;
  font-weight: 600;
}
.stat-card strong {
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 7px 0;
}
.stat-card small {
  display: block;
  color: #8c98a8;
  font-size: 0.72rem;
}
.stat-card:hover {
  transform: translateY(-2px);
}
.dashboard-content {
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.8fr);
  gap: 18px;
  margin-top: 20px;
}
.panel,
.table-card,
form {
  border-color: #e8edf4;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.panel {
  padding: 24px;
}
.panel h2 {
  font-size: 1.16rem;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}
.panel-heading p:not(.eyebrow),
.quick-panel > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 18px;
}
.text-link {
  font-size: 0.8rem;
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}
.movement-list p {
  padding: 15px 0;
  margin: 0;
  border-bottom: 1px solid #edf1f6;
  color: #43546a;
  font-size: 0.84rem;
}
.movement-list p:last-child {
  border-bottom: 0;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid #edf1f6;
}
.quick-link > span:nth-child(2) {
  display: grid;
  gap: 2px;
  flex: 1;
}
.quick-link strong {
  font-size: 0.83rem;
}
.quick-link small {
  font-size: 0.72rem;
  color: var(--muted);
}
.quick-link b {
  font-size: 1rem;
  color: #9aabc0;
}
.quick-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eef4ff;
  color: #2864e8;
  font-weight: 800;
}
.quick-link:hover strong,
.text-link:hover {
  color: #1749b8;
}
.toolbar {
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.toolbar label,
.form-grid label,
form label,
.panel > label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #45566d;
}
.table-card {
  padding: 10px 20px;
}
table {
  min-width: 680px;
}
th {
  background: #f7f9fc;
  color: #738198;
  font-size: 0.7rem;
}
td {
  font-size: 0.85rem;
}
input,
select,
textarea {
  margin-top: 5px;
  border-color: #dce4ee;
  border-radius: 9px;
  font-size: 0.9rem;
}
form label,
.panel > label {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
}
.panel form {
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: none;
}
.sale-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
}
.sale-summary {
  border-radius: 16px;
  background: #172d4c;
  box-shadow: var(--shadow);
}
.anchor-panel {
  margin-top: 20px;
}
.form-result:empty {
  display: none;
}
dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: auto;
  border: 0;
  padding: 0;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(17, 37, 67, 0.24);
}
dialog::backdrop {
  background: rgba(12, 27, 47, 0.58);
}
dialog form {
  border: 0;
  box-shadow: none;
  margin: 0;
  padding: 28px;
}
dialog h2 {
  font-size: 1.35rem;
}
.login-shell {
  max-width: 1000px;
}
.login-brand {
  background: linear-gradient(145deg, #132d50, #0f2038);
}
.login-card h2 {
  font-size: 2rem;
}
.login-card p {
  color: var(--muted);
}
@media (max-width: 1000px) {
  .dashboard-content {
    grid-template-columns: 1fr;
  }
  .app-main {
    padding: 28px;
  }
  .app-top {
    padding: 0 26px;
  }
}
@media (max-width: 900px) {
  .app-body {
    padding-left: 0;
  }
  .sidebar {
    transform: translateX(-105%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .app-top .menu-button {
    display: block;
  }
  .sale-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .app-main {
    padding: 20px 16px;
  }
  .app-top {
    padding: 0 16px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-card {
    min-height: 148px;
    padding: 15px;
  }
  .stat-card strong {
    font-size: 1.35rem;
  }
  .stat-card small {
    font-size: 0.65rem;
  }
  .panel {
    padding: 19px;
  }
  .panel-heading {
    flex-direction: column;
    gap: 2px;
  }
  .toolbar label {
    min-width: 100%;
  }
  .welcome h1 {
    font-size: 1.85rem;
  }
  .user-chip {
    font-size: 0.69rem;
  }
  .sale-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stat-card {
    padding: 12px;
  }
  .stat-card strong {
    font-size: 1.15rem;
  }
}
[hidden] {
  display: none !important;
}
.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 20px;
}
.report-filters {
  display: flex;
  gap: 14px;
  align-items: end;
}
.report-filters label {
  flex: 1;
  margin: 0;
}
.report-filters button {
  flex: none;
}
.report-grid p,
#reportLow p {
  padding: 12px 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
@media (max-width: 700px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
  .report-filters {
    display: grid;
  }
}
.management-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 20px;
}
.management-row,
.panel .management-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.management-row input:not([type='checkbox']) {
  flex: 1;
  min-width: 0;
}
.management-row select {
  max-width: 150px;
}
.management-row strong {
  min-width: 120px;
  font-size: 0.84rem;
}
.check-inline {
  display: flex !important;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  margin: 0 !important;
}
.check-inline input {
  width: auto;
  margin: 0;
}
.user-row {
  flex-wrap: wrap;
}
@media (max-width: 620px) {
  .management-row {
    flex-wrap: wrap;
  }
  .management-row input:not([type='checkbox']) {
    min-width: 100%;
  }
  .management-row strong {
    min-width: 100%;
  }
}
.sales-chart {
  min-height: 210px;
  display: flex;
  align-items: center;
}
.sales-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart-gridline {
  stroke: #e9eef6;
  stroke-width: 1;
}
.chart-bar {
  fill: #326ce8;
}
.chart-amount {
  fill: #41536d;
  font-size: 11px;
  font-weight: 700;
}
.chart-date {
  fill: #75849a;
  font-size: 12px;
  font-weight: 600;
}
.chart-empty {
  width: 100%;
  padding: 40px 20px;
  text-align: center;
  background: #f8faff;
  border: 1px dashed #dce6f5;
  border-radius: 12px;
  color: #687a93;
  font-size: 0.9rem;
}
.sales-chart-details {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 620px) {
  .sales-chart {
    min-height: 145px;
  }
  .chart-amount {
    font-size: 10px;
  }
  .chart-date {
    font-size: 11px;
  }
}
/* Account controls and management tables */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.profile-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d9e6ff;
  color: #2864e8;
  font-size: 12px;
  position: relative;
}
.profile-avatar::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 14px;
  height: 7px;
  background: #2864e8;
  border-radius: 8px 8px 5px 5px;
}
.profile-avatar {
  padding-bottom: 7px;
}
.theme-switch,
.icon-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid #dce5f1;
  background: #fff;
  color: #344d70;
  border-radius: 10px;
  width: 39px;
  height: 39px;
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}
.theme-switch:hover,
.icon-button:hover {
  background: #f1f6ff;
}
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}
.section-header h2 {
  margin-bottom: 4px;
}
.section-header p:not(.eyebrow) {
  margin: 0;
  color: #718096;
  font-size: 0.85rem;
}
.user-list-panel {
  padding: 24px;
}
.user-table {
  min-width: 800px;
}
.row-actions {
  white-space: nowrap;
}
.action-button {
  border: 0;
  background: transparent;
  color: #2864e8;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
}
.action-button:hover {
  background: #eef4ff;
}
.action-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.action-danger {
  color: #c24145;
}
.action-danger:hover {
  background: #fff0f0;
}
.status-pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.status-active {
  background: #e4f7ed;
  color: #16804a;
}
.status-inactive {
  background: #eef1f5;
  color: #68788d;
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.dialog-heading h2 {
  margin: 0 0 6px;
}
.dialog-heading p:not(.eyebrow),
.form-hint {
  color: #718096;
  font-size: 0.83rem;
  margin: 0;
}
.dialog-heading .icon-button {
  flex: none;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.dialog-error {
  color: #b42318;
  font-weight: 600;
  font-size: 0.83rem;
  min-height: 1em;
}
.categories-panel .table-scroll {
  margin-top: 8px;
}
.categories-panel table {
  min-width: 580px;
}
.form-hint {
  margin-top: 8px;
}
.cart-table input {
  max-width: 90px;
}
.sale-workspace {
  align-items: start;
}
.sale-cart-panel {
  padding: 26px;
}
.sale-panel-heading {
  margin-bottom: 22px;
}
.sale-entry {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px auto;
  align-items: end;
  gap: 12px;
  padding: 18px;
  background: #f7f9fd;
  border: 1px solid #e8edf5;
  border-radius: 12px;
}
.sale-entry label {
  display: grid;
  gap: 4px;
  margin: 0;
  color: #485a73;
  font-size: 0.8rem;
  font-weight: 700;
}
.sale-entry .button {
  min-height: 47px;
}
.sale-quantity-field input {
  margin: 0;
}
.cart-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 27px 0 10px;
}
.cart-heading h3 {
  font-size: 0.95rem;
  margin: 0;
}
.cart-heading span {
  font-size: 0.77rem;
  color: #8492a4;
}
.cart-empty {
  padding: 25px 12px;
  text-align: center;
  color: #8290a3;
  font-size: 0.84rem;
}
.sale-summary h2 {
  color: #fff;
  font-size: 1.18rem;
  margin: 0 0 8px;
}
.summary-eyebrow {
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: #8eb7ff;
  margin-bottom: 8px;
}
.summary-info,
.summary-note {
  display: block !important;
  color: #b5c5d9;
  font-size: 0.79rem;
  line-height: 1.5;
}
.summary-divider {
  height: 1px;
  background: #42536c;
  margin: 20px 0;
}
.summary-line {
  font-size: 0.88rem;
  color: #c6d3e2;
}
.sale-summary .total {
  align-items: center;
  font-size: 0.95rem;
  color: #dce6f4;
}
.sale-summary .total strong {
  color: white;
  font-size: 1.45rem;
}
.sale-summary .summary-note {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.72rem;
}
.sales-history #history p {
  padding: 12px 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
}
.history-detail {
  margin-left: 8px;
}
@media (max-width: 700px) {
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .sale-entry {
    grid-template-columns: 1fr 100px;
  }
  .sale-product-field {
    grid-column: 1/-1;
  }
  .sale-entry .button {
    width: 100%;
  }
  .header-controls {
    gap: 6px;
  }
  .profile-avatar {
    display: none;
  }
  .user-chip {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
}
/* Theme preference controls presentation only; business data remains server-side. */
html[data-theme='dark'] {
  color-scheme: dark;
  --ink: #e5edf9;
  --muted: #a2b2c9;
  --paper: #101a2a;
  --white: #1a2a40;
  --line: #31445e;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
html[data-theme='dark'] body,
html[data-theme='dark'] .app-body {
  background: #101a2a;
  color: #e5edf9;
}
html[data-theme='dark'] .app-top,
html[data-theme='dark'] .panel,
html[data-theme='dark'] .table-card,
html[data-theme='dark'] form,
html[data-theme='dark'] .toolbar,
html[data-theme='dark'] .stat-card,
html[data-theme='dark'] dialog {
  background: #1a2a40;
  color: #e5edf9;
  border-color: #31445e;
}
html[data-theme='dark'] input,
html[data-theme='dark'] select,
html[data-theme='dark'] textarea {
  background: #132237;
  color: #edf4ff;
  border-color: #425672;
}
html[data-theme='dark'] th {
  background: #22344d;
  color: #a9bdd6;
}
html[data-theme='dark'] td,
html[data-theme='dark'] th,
html[data-theme='dark'] .quick-link,
html[data-theme='dark'] .management-row {
  border-color: #31445e;
}
html[data-theme='dark'] tbody tr:hover {
  background: #233751;
}
html[data-theme='dark'] .theme-switch,
html[data-theme='dark'] .icon-button,
html[data-theme='dark'] .button.secondary {
  background: #253a56;
  color: #e5edf9;
  border-color: #405571;
}
html[data-theme='dark'] .user-chip {
  background: #263c5d;
  color: #d9e8ff;
  border-color: #425a7c;
}
html[data-theme='dark'] .toolbar label,
html[data-theme='dark'] .form-grid label,
html[data-theme='dark'] form label,
html[data-theme='dark'] .panel > label,
html[data-theme='dark'] .sale-entry label {
  color: #d0dcef;
}
html[data-theme='dark'] .sale-entry,
html[data-theme='dark'] .chart-empty {
  background: #14243a;
  border-color: #344a67;
}
html[data-theme='dark'] .action-button {
  color: #a6c5ff;
}
html[data-theme='dark'] .action-danger {
  color: #ff9a9a;
}
html[data-theme='dark'] .action-button:hover {
  background: #2b4160;
}
html[data-theme='dark'] .status-active {
  background: #174d3d;
  color: #9de4bf;
}
html[data-theme='dark'] .status-inactive {
  background: #34455a;
  color: #d0deed;
}
html[data-theme='dark'] .chart-gridline {
  stroke: #425672;
}
html[data-theme='dark'] .chart-amount,
html[data-theme='dark'] .chart-date {
  fill: #c6d5e8;
}
html[data-theme='dark'] .sale-summary {
  background: #203653;
}
html[data-theme='dark'] dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}
/* Perfil compacto del usuario */
.app-top > .header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.profile-control {
  position: relative;
}
.profile-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #dce5f1;
  border-radius: 50%;
  background: #edf3ff;
  cursor: pointer;
}
.profile-button:hover,
.profile-button[aria-expanded='true'] {
  background: #dfeaff;
  border-color: #b9cdf4;
}
.profile-button:focus-visible {
  outline: 3px solid #8cb1ff;
  outline-offset: 2px;
}
.profile-button .profile-avatar {
  display: grid;
}
.profile-details {
  position: absolute;
  z-index: 60;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  max-width: min(280px, calc(100vw - 32px));
  padding: 16px 18px;
  border: 1px solid #e4eaf2;
  border-radius: 14px;
  background: #fff;
  color: #192a43;
  box-shadow: 0 14px 36px rgba(28, 49, 85, 0.16);
}
.profile-details strong,
.profile-details span {
  display: block;
  overflow-wrap: anywhere;
}
.profile-details strong {
  font-size: 0.92rem;
  margin: 5px 0;
}
.profile-caption {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #8494a9;
}
.profile-role {
  font-size: 0.75rem;
  color: #6d7c91;
}
.app-top {
  position: relative;
  z-index: 30;
}
html[data-theme='dark'] .profile-button {
  background: #263c5d;
  border-color: #425a7c;
}
html[data-theme='dark'] .profile-button:hover,
html[data-theme='dark'] .profile-button[aria-expanded='true'] {
  background: #344d73;
}
html[data-theme='dark'] .profile-details {
  background: #1a2a40;
  color: #e5edf9;
  border-color: #405571;
}
html[data-theme='dark'] .profile-role {
  color: #b1c0d5;
}
/* Punto de venta y resumen diario */
.pos-heading {
  margin-bottom: 24px;
}
.pos-heading h1 {
  font-size: clamp(1.9rem, 3vw, 2.65rem);
  letter-spacing: -0.04em;
  margin: 0 0 7px;
}
.pos-heading > div > p:last-child {
  color: var(--muted);
  font-size: 0.91rem;
  margin: 0;
}
.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 20px;
  align-items: start;
}
.pos-catalog,
.pos-checkout {
  padding: 25px;
  min-width: 0;
}
.pos-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.pos-section-heading h2 {
  font-size: 1.17rem;
  margin: 0 0 5px;
}
.pos-section-heading p:not(.eyebrow) {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}
.pos-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #73839a;
  white-space: nowrap;
}
.pos-filters {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.pos-filters label {
  min-width: 0;
}
.pos-filters input,
.pos-filters select {
  margin: 0;
}
.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;
}
.pos-product-list {
  max-height: 560px;
  overflow-y: auto;
}
.pos-product-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.pos-product-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: #edf3ff;
  color: #2864e8;
  font-size: 1.1rem;
  font-weight: 700;
}
.pos-product-info,
.pos-cart-info {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.pos-product-info strong,
.pos-cart-info strong {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.pos-product-info small,
.pos-cart-info small {
  font-size: 0.75rem;
  color: var(--muted);
}
.pos-product-price {
  font-size: 0.86rem;
  white-space: nowrap;
}
.pos-add {
  padding: 8px 11px;
  border: 1px solid #dce7ff;
  border-radius: 9px;
  background: #f1f6ff;
  color: #235bd3;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.pos-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pos-add:hover:not(:disabled) {
  background: #e3edff;
}
.pos-client {
  padding: 16px;
  background: #f7f9fd;
  border: 1px solid #e7edf7;
  border-radius: 12px;
}
.pos-client-heading,
.pos-cart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pos-client-heading strong,
.pos-cart-heading h3 {
  font-size: 0.88rem;
}
.pos-client-default {
  font-size: 0.68rem;
  color: #6380a8;
}
.pos-client-fields {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  margin-top: 11px;
}
.pos-client-fields label {
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #50617b;
}
.pos-client-fields input {
  margin: 0;
}
.pos-optional {
  font-weight: 400;
  color: var(--muted);
}
.pos-hint {
  font-size: 0.72rem;
  line-height: 1.45;
  color: #7a8aa0;
  margin: 9px 0 0;
}
.pos-cart-heading {
  margin: 22px 0 8px;
}
.pos-cart-heading h3 {
  margin: 0;
}
.pos-cart-heading span {
  font-size: 0.75rem;
  color: var(--muted);
}
.pos-cart {
  max-height: 260px;
  overflow-y: auto;
}
.pos-cart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.pos-cart-row input {
  width: 60px;
  margin: 0;
  padding: 8px;
}
.pos-line-total {
  font-size: 0.83rem;
  white-space: nowrap;
}
.pos-remove {
  border: 0;
  background: transparent;
  color: #9a6b70;
  font-size: 1.2rem;
  cursor: pointer;
}
.pos-empty {
  padding: 28px 10px;
  text-align: center;
  color: #8b99aa;
  font-size: 0.82rem;
}
.pos-payment {
  border: 0;
  padding: 0;
  margin: 22px 0 0;
}
.pos-payment legend {
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.payment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.payment-options label {
  margin: 0;
  display: block;
  cursor: pointer;
}
.payment-options input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.payment-options span {
  display: block;
  padding: 8px 11px;
  border: 1px solid #dce5f2;
  border-radius: 9px;
  color: #61728b;
  font-size: 0.75rem;
  font-weight: 700;
}
.payment-options input:checked + span {
  background: #eaf1ff;
  color: #2259cc;
  border-color: #9bbafa;
}
.payment-options input:focus-visible + span {
  outline: 3px solid #8cb1ff;
  outline-offset: 2px;
}
.pos-totals {
  border-top: 1px solid var(--line);
  margin-top: 19px;
  padding-top: 15px;
}
.pos-totals p {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0 0 10px;
}
.pos-totals .pos-total {
  align-items: center;
  color: var(--ink);
  font-weight: 700;
}
.pos-total strong {
  font-size: 1.55rem;
  color: var(--blue);
}
.pos-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  margin-top: 16px;
}
.daily-filter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.daily-filter h2 {
  margin-bottom: 4px;
}
.daily-filter p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.daily-filter form {
  display: flex;
  align-items: end;
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
}
.daily-filter form label {
  margin: 0;
}
.daily-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-top: 18px;
}
.daily-cards .stat-card {
  min-height: 120px;
}
.daily-detail table {
  min-width: 760px;
}
html[data-theme='dark'] .pos-client {
  background: #14243a;
  border-color: #344a67;
}
html[data-theme='dark'] .pos-client-fields label {
  color: #d0dcef;
}
html[data-theme='dark'] .pos-product-icon {
  background: #263c5d;
  color: #a6c5ff;
}
html[data-theme='dark'] .pos-add {
  background: #263c5d;
  color: #c2d7ff;
  border-color: #425a7c;
}
html[data-theme='dark'] .payment-options span {
  color: #c2d2e8;
  border-color: #425a7c;
}
html[data-theme='dark'] .payment-options input:checked + span {
  background: #31578a;
  color: #fff;
  border-color: #7aa4ed;
}
html[data-theme='dark'] .daily-filter form {
  background: transparent;
}
@media (max-width: 1100px) {
  .pos-layout {
    grid-template-columns: 1fr;
  }
  .pos-product-list {
    max-height: 340px;
  }
  .daily-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .pos-catalog,
  .pos-checkout {
    padding: 18px;
  }
  .pos-filters {
    grid-template-columns: 1fr;
  }
  .pos-client-fields {
    grid-template-columns: 1fr;
  }
  .pos-product-row {
    flex-wrap: wrap;
  }
  .pos-product-info {
    min-width: calc(100% - 60px);
  }
  .pos-product-price {
    margin-left: 57px;
  }
  .pos-add {
    margin-left: auto;
  }
  .pos-cart-row {
    flex-wrap: wrap;
  }
  .pos-cart-info {
    min-width: calc(100% - 90px);
  }
  .pos-actions {
    grid-template-columns: 1fr;
  }
  .daily-filter {
    align-items: stretch;
    flex-direction: column;
  }
  .daily-filter form {
    flex-wrap: wrap;
  }
  .daily-cards {
    gap: 10px;
  }
  .daily-cards .stat-card {
    padding: 15px;
    min-height: 105px;
  }
  .daily-cards .stat-card strong {
    font-size: 1.15rem;
  }
}
.kardex-selector .section-header {
  margin-bottom: 14px;
}
.kardex-filters,
.kardex-adjust-form {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(130px, 1fr) minmax(130px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.kardex-filters label,
.kardex-adjust-form label {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
}
.kardex-filters input,
.kardex-filters select,
.kardex-adjust-form input {
  margin: 0;
}
.kardex-filters button,
.kardex-adjust-form button {
  min-height: 46px;
}
.kardex-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.kardex-grid .stat-card {
  min-height: 115px;
}
.kardex-grid .kardex-product-name {
  font-size: 1.15rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.kardex-adjust-form {
  grid-template-columns: minmax(150px, 1fr) minmax(200px, 2fr) auto;
}
.kardex-prompt {
  text-align: center;
  margin-top: 20px;
  padding: 46px 24px;
}
.kardex-prompt-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #eaf1ff;
  color: #2864e8;
  font-size: 1.4rem;
  margin: 0 auto 14px;
}
.kardex-prompt p {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}
html[data-theme='dark'] .kardex-filters,
html[data-theme='dark'] .kardex-adjust-form {
  background: transparent;
}
html[data-theme='dark'] .kardex-prompt-icon {
  background: #263c5d;
  color: #a6c5ff;
}
@media (max-width: 1000px) {
  .kardex-filters {
    grid-template-columns: 1fr 1fr;
  }
  .kardex-product-filter {
    grid-column: 1/-1;
  }
  .kardex-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .kardex-filters,
  .kardex-adjust-form {
    grid-template-columns: 1fr;
  }
  .kardex-product-filter {
    grid-column: auto;
  }
  .kardex-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .kardex-grid .stat-card:first-child {
    grid-column: 1/-1;
  }
  .kardex-grid .stat-card {
    min-height: 100px;
  }
}
/* Registro de compras */
.purchase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  align-items: start;
}
.purchase-main {
  min-width: 0;
  padding: 26px;
}
.purchase-supplier {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  color: #485a73;
  font-size: 0.8rem;
  font-weight: 700;
}
.purchase-supplier select {
  margin: 0;
}
.purchase-entry {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(90px, 0.65fr) minmax(110px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  background: #f7f9fd;
  border: 1px solid #e8edf5;
  border-radius: 12px;
}
.purchase-entry label {
  display: grid;
  gap: 4px;
  margin: 0;
  color: #485a73;
  font-size: 0.8rem;
  font-weight: 700;
}
.purchase-entry label span {
  color: #8795a8;
  font-weight: 400;
}
.purchase-entry input,
.purchase-entry select {
  margin: 0;
}
.purchase-entry .button {
  min-height: 46px;
}
.purchase-summary .total {
  align-items: center;
}
.suppliers-dialog {
  width: min(720px, calc(100vw - 32px));
}
.supplier-modal {
  padding: 28px;
}
.supplier-create,
.panel .supplier-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 0;
  padding: 16px;
  background: #f7f9fd;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  box-shadow: none;
}
.supplier-create label {
  margin: 0;
  display: grid;
  gap: 4px;
}
.supplier-create input {
  margin: 0;
}
.supplier-create button {
  min-height: 46px;
}
.supplier-list-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 23px;
}
.supplier-list-heading h3 {
  margin: 0;
  font-size: 0.92rem;
}
.supplier-list-heading span {
  color: var(--muted);
  font-size: 0.75rem;
}
.suppliers-dialog .management-list {
  max-height: 260px;
  overflow-y: auto;
}
.suppliers-dialog .management-row {
  margin: 0;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.suppliers-dialog .dialog-error {
  min-height: 0;
  margin: 8px 0 0;
  color: #157347;
}
.suppliers-dialog .dialog-error.is-error {
  color: #b42318;
}
.whatsapp-support {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 35;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #20bd60;
  box-shadow: 0 8px 22px rgba(16, 120, 59, 0.28);
  transition:
    transform 0.2s,
    background 0.2s;
}
.whatsapp-support:hover {
  background: #16a750;
  transform: translateY(-3px);
}
.whatsapp-support:focus-visible {
  outline: 3px solid #85dba8;
  outline-offset: 3px;
}
.whatsapp-support img {
  display: block;
  width: 32px;
  height: 32px;
}
.app-body {
  padding-bottom: 80px;
}
html[data-theme='dark'] .purchase-entry,
html[data-theme='dark'] .supplier-create {
  background: #14243a;
  border-color: #344a67;
}
html[data-theme='dark'] .purchase-supplier,
html[data-theme='dark'] .purchase-entry label {
  color: #d0dcef;
}
html[data-theme='dark'] .suppliers-dialog .management-row {
  background: transparent;
}
html[data-theme='dark'] .suppliers-dialog .dialog-error {
  color: #9de4bf;
}
html[data-theme='dark'] .suppliers-dialog .dialog-error.is-error {
  color: #ff9a9a;
}
@media (max-width: 1000px) {
  .purchase-layout {
    grid-template-columns: 1fr;
  }
  .purchase-entry {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .purchase-product {
    grid-column: 1/-1;
  }
}
@media (max-width: 620px) {
  .purchase-main {
    padding: 19px;
  }
  .purchase-entry {
    grid-template-columns: 1fr 1fr;
  }
  .purchase-entry .button {
    grid-column: 1/-1;
  }
  .supplier-modal {
    padding: 20px;
  }
  .supplier-create,
  .panel .supplier-create {
    grid-template-columns: 1fr;
  }
  .supplier-list-heading {
    align-items: start;
    flex-direction: column;
  }
  .whatsapp-support {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
  }
  .whatsapp-support img {
    width: 30px;
    height: 30px;
  }
}
/* Catalogo de productos */
.catalog-panel {
  padding: 25px;
}
.catalog-heading {
  margin-bottom: 18px;
}
.catalog-count {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f2f6fd;
  color: #657b9a;
  font-size: 0.73rem;
  font-weight: 700;
}
.catalog-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px);
  gap: 13px;
  padding: 16px;
  margin-bottom: 17px;
  background: #f7f9fd;
  border: 1px solid #e8edf5;
  border-radius: 12px;
}
.catalog-filters label {
  display: grid;
  gap: 5px;
  color: #4c5f79;
  font-size: 0.78rem;
  font-weight: 700;
}
.catalog-filters input,
.catalog-filters select {
  margin: 0;
}
.catalog-table {
  min-width: 800px;
}
.catalog-table td {
  vertical-align: middle;
}
.catalog-name {
  font-weight: 700;
  color: var(--ink);
}
.catalog-code {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 7px;
  background: #f0f4fa;
  color: #60738d;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.catalog-stock-low {
  color: #ad720b;
  font-weight: 700;
}
.status-low {
  background: #fff3dd;
  color: #a76c08;
}
.catalog-footnote {
  margin: 14px 0 0;
  color: #8a98a9;
  font-size: 0.72rem;
}
.product-active-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.product-active-check input {
  width: auto;
  margin: 0;
}
.categories-panel table td {
  vertical-align: middle;
}
html[data-theme='dark'] .catalog-filters {
  background: #14243a;
  border-color: #344a67;
}
html[data-theme='dark'] .catalog-filters label {
  color: #d0dcef;
}
html[data-theme='dark'] .catalog-count,
html[data-theme='dark'] .catalog-code {
  background: #263c5d;
  color: #c2d7ff;
}
html[data-theme='dark'] .status-low {
  background: #5e461d;
  color: #ffda91;
}
html[data-theme='dark'] .catalog-stock-low {
  color: #ffda91;
}
@media (max-width: 700px) {
  .catalog-panel {
    padding: 18px;
  }
  .catalog-filters {
    grid-template-columns: 1fr;
  }
  .catalog-heading {
    gap: 10px;
  }
  .catalog-count {
    align-self: flex-start;
  }
}
/* Estadisticas de rotacion y reposicion */
.stats-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.stats-insights .stat-card {
  min-height: 162px;
}
.insight-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 11px;
  margin-bottom: 14px;
  font-weight: 800;
  font-size: 1rem;
}
.insight-high .insight-icon {
  background: #e6f6ef;
  color: #168456;
}
.insight-reorder .insight-icon {
  background: #fff2df;
  color: #bc7610;
}
.insight-out .insight-icon {
  background: #ffebeb;
  color: #c34848;
}
.insight-unknown .insight-icon {
  background: #eef2f7;
  color: #71839a;
}
.statistics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 5px 0 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.statistics-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.rotation-high {
  background: #1b9e64;
}
.legend-dot.rotation-medium {
  background: #3281db;
}
.legend-dot.rotation-low {
  background: #bd8b28;
}
.legend-dot.rotation-unknown {
  background: #96a4b5;
}
.legend-dot.reorder-color {
  background: #d64d4d;
}
.stats-filters {
  margin-bottom: 16px;
}
.statistics-table {
  min-width: 940px;
}
.statistics-table td {
  vertical-align: middle;
}
.stats-product-meta {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 3px;
}
.rotation-badge,
.reorder-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.rotation-badge.rotation-high {
  background: #e2f7eb;
  color: #147647;
}
.rotation-badge.rotation-medium {
  background: #e8f2ff;
  color: #2868bb;
}
.rotation-badge.rotation-low {
  background: #fff3dc;
  color: #936511;
}
.rotation-badge.rotation-unknown {
  background: #edf1f5;
  color: #66788c;
}
.reorder-needed {
  background: #fff0ec;
  color: #b34739;
}
.reorder-ok {
  background: #f0f4f8;
  color: #6d7c91;
}
.statistics-notes {
  margin-top: 20px;
  padding: 17px 19px;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  background: #f8faff;
  color: #6d7c91;
  font-size: 0.77rem;
  line-height: 1.6;
}
.statistics-notes strong {
  display: block;
  color: #425672;
  font-size: 0.8rem;
  margin-bottom: 5px;
}
.statistics-notes p {
  margin: 6px 0 0;
}
html[data-theme='dark'] .statistics-notes {
  background: #14243a;
  border-color: #344a67;
  color: #a9bdd6;
}
html[data-theme='dark'] .statistics-notes strong {
  color: #d0deed;
}
html[data-theme='dark'] .rotation-badge.rotation-high {
  background: #174d3d;
  color: #a0e8bf;
}
html[data-theme='dark'] .rotation-badge.rotation-medium {
  background: #24456b;
  color: #b5d6ff;
}
html[data-theme='dark'] .rotation-badge.rotation-low {
  background: #5e461d;
  color: #ffda91;
}
html[data-theme='dark'] .rotation-badge.rotation-unknown,
html[data-theme='dark'] .reorder-ok {
  background: #34455a;
  color: #d0deed;
}
html[data-theme='dark'] .reorder-needed {
  background: #693837;
  color: #ffc3b8;
}
@media (max-width: 1100px) {
  .stats-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .stats-insights {
    gap: 10px;
  }
  .stats-insights .stat-card {
    min-height: 145px;
  }
  .statistics-legend {
    gap: 10px;
  }
  .statistics-panel {
    padding: 18px;
  }
}
