/*
 * AromaClean Premium Lock
 * Capa visual de protección: conserva la estructura y funciones existentes.
 * Debe cargarse después de app.css y store.css.
 */

:root {
  --premium-surface: #ffffff;
  --premium-surface-soft: #f8fbfb;
  --premium-text-strong: #102a25;
  --premium-ring: rgba(7, 92, 79, .16);
  --premium-shadow-sm: 0 8px 24px rgba(20, 56, 68, .07);
  --premium-shadow-md: 0 18px 48px rgba(20, 56, 68, .10);
  --premium-shadow-lg: 0 28px 80px rgba(20, 56, 68, .14);
  --premium-radius-sm: 12px;
  --premium-radius-md: 18px;
  --premium-radius-lg: 24px;
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background:
    radial-gradient(circle at 100% 0, rgba(9, 185, 208, .08), transparent 30rem),
    radial-gradient(circle at 0 100%, rgba(7, 92, 79, .07), transparent 34rem),
    var(--bg);
}

button,
.button-link,
.secondary-button,
.store-primary-button,
.store-secondary-link,
input,
select,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
.button-link,
.secondary-button,
.store-primary-button,
.store-whatsapp-button {
  min-height: 42px;
  border-radius: 13px;
  font-weight: 800;
  letter-spacing: -.01em;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, opacity .18s ease;
}

button:not(:disabled):hover,
.button-link:hover,
.secondary-button:hover,
.store-primary-button:hover,
.store-whatsapp-button:hover {
  transform: translateY(-1px);
}

button:not(:disabled):active,
.button-link:active,
.secondary-button:active,
.store-primary-button:active,
.store-whatsapp-button:active {
  transform: translateY(0) scale(.985);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--premium-ring);
  outline-offset: 2px;
}

button[type="submit"],
.button-link,
.store-primary-button {
  box-shadow: 0 10px 24px rgba(7, 92, 79, .18);
}

button[type="submit"]:not(.secondary-button):not(.logout):not(.store-clear-cart),
.button-link,
.store-primary-button {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #fff;
  border-color: transparent;
}

.secondary-button,
.logout,
.store-clear-cart {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(20, 56, 68, .05);
}

input,
select,
textarea {
  min-height: 46px;
  border-radius: 13px;
  border: 1px solid #d9e5e5;
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(20, 56, 68, .025);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #bfd4d1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px var(--premium-ring);
  background: #fff;
}

input[readonly],
input:disabled,
select:disabled,
textarea:disabled {
  background: #f3f7f7;
  color: var(--muted);
}

::placeholder {
  color: #97a9ad;
  opacity: 1;
}

.app-shell {
  grid-template-columns: 268px minmax(0, 1fr);
}

.sidebar {
  padding: 24px 17px;
  background:
    radial-gradient(circle at 20% 0, rgba(255, 255, 255, .13), transparent 14rem),
    linear-gradient(180deg, var(--brand-primary), #043c35 72%, #032f2a);
  border-right: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 12px 0 40px rgba(5, 47, 42, .12);
}

.brand {
  min-height: 68px;
  padding: 4px 10px 24px;
  letter-spacing: -.035em;
}

.brand img {
  width: 46px;
  height: 46px;
  padding: 5px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .14);
  object-fit: contain;
}

.sidebar nav {
  gap: 6px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.sidebar nav a {
  position: relative;
  min-height: 45px;
  border: 1px solid transparent;
  color: rgba(239, 255, 251, .82);
  font-weight: 690;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}

.sidebar nav a:hover {
  transform: translateX(2px);
  color: #fff;
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .08);
}

.sidebar nav a.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, .20), rgba(9, 185, 208, .18));
  border-color: rgba(255, 255, 255, .17);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, .9), 0 10px 24px rgba(0, 0, 0, .10);
}

.sidebar-user {
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .10);
  backdrop-filter: blur(10px);
}

.main-content {
  padding: 0 clamp(18px, 2.4vw, 38px) 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 88px;
  height: auto;
  padding: 14px 0;
  background: rgba(244, 247, 248, .82);
  border-bottom: 1px solid rgba(217, 229, 229, .76);
  backdrop-filter: blur(18px) saturate(140%);
}

.topbar-title strong {
  font-size: 17px;
  letter-spacing: -.02em;
}

.topbar-title small {
  margin-top: 2px;
}

.topbar-profile,
.topbar-notifications,
.menu-button {
  box-shadow: var(--premium-shadow-sm);
}

.topbar-profile {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  border: 2px solid rgba(255, 255, 255, .9);
  font-weight: 900;
}

.topbar-install {
  min-height: 40px;
  border-radius: 13px;
  box-shadow: var(--premium-shadow-sm);
}

.page-actions {
  gap: 18px;
  margin: 28px 0 20px;
}

.page-actions h1,
.welcome-card h1,
.store-hero h1,
.store-checkout-head h1,
.store-success h1 {
  letter-spacing: -.045em;
  color: var(--premium-text-strong);
}

.page-actions p,
.panel-head p,
.welcome-card p {
  line-height: 1.55;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 135, 93, .09);
  letter-spacing: .105em;
}

.welcome-card,
.panel,
.stats-grid article,
.store-checkout-card,
.store-order-summary,
.store-success {
  border-color: rgba(215, 228, 228, .9);
  box-shadow: var(--premium-shadow-md);
}

.panel,
.stats-grid article,
.welcome-card {
  overflow: clip;
}

.panel {
  border-radius: var(--premium-radius-lg);
}

.panel-head {
  gap: 16px;
}

.stats-grid article {
  position: relative;
  min-height: 118px;
  border-radius: 20px;
  background: linear-gradient(145deg, #fff, #fbfdfd);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.stats-grid article::after {
  content: "";
  position: absolute;
  inset: auto 16px 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  opacity: .65;
}

.stats-grid article:hover {
  transform: translateY(-2px);
  border-color: rgba(7, 92, 79, .18);
  box-shadow: var(--premium-shadow-lg);
}

.stats-grid strong {
  color: var(--premium-text-strong);
  letter-spacing: -.035em;
}

.alert {
  border: 1px solid transparent;
  box-shadow: var(--premium-shadow-sm);
}

.alert.success {
  border-color: #bfe2d2;
}

.alert.error {
  border-color: #f0c4bf;
}

.badge {
  border: 1px solid rgba(20, 56, 68, .07);
  font-weight: 800;
}

.responsive-table {
  border: 1px solid var(--border);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20, 56, 68, .045);
}

.responsive-table table {
  margin: 0;
}

.responsive-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f8f8;
  color: #536c68;
  font-weight: 850;
}

.responsive-table tbody tr {
  transition: background-color .16s ease;
}

.responsive-table tbody tr:hover {
  background: #f7fbfa;
}

.responsive-table td,
.responsive-table th {
  border-bottom-color: #e6eeee;
}

.pagination a,
.pagination span {
  min-width: 38px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
}

.pagination a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  box-shadow: 0 8px 18px rgba(7, 92, 79, .18);
}

.product-card,
.pos-product-card,
.store-product-card,
.store-category-grid a,
.security-tool-grid a,
.quick-actions a {
  border-color: rgba(215, 228, 228, .92);
  box-shadow: var(--premium-shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.product-card:hover,
.pos-product-card:hover,
.store-product-card:hover,
.store-category-grid a:hover,
.security-tool-grid a:hover,
.quick-actions a:hover {
  transform: translateY(-3px);
  border-color: rgba(7, 92, 79, .20);
  box-shadow: var(--premium-shadow-lg);
}

.product-image,
.pos-product-image,
.store-product-image,
.store-product-detail-image {
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, .98), transparent 10rem),
    linear-gradient(145deg, #f9fdfc, #eaf7f3);
}

.product-image img,
.pos-product-image img,
.store-product-image img,
.store-product-detail-image img {
  filter: drop-shadow(0 16px 18px rgba(20, 56, 68, .13));
  transition: transform .22s ease;
}

.product-card:hover img,
.pos-product-card:hover img,
.store-product-card:hover img {
  transform: scale(1.035);
}

.store-whatsapp-button {
  background: linear-gradient(135deg, #16a66a, #0b8f57);
  box-shadow: 0 12px 28px rgba(22, 166, 106, .24);
}

.auth-page,
.install-page {
  background:
    radial-gradient(circle at 15% 15%, rgba(9, 185, 208, .13), transparent 26rem),
    radial-gradient(circle at 85% 85%, rgba(7, 92, 79, .14), transparent 30rem),
    linear-gradient(145deg, #f7fbfb, #eaf5f2);
}

.auth-card,
.installer {
  border: 1px solid rgba(215, 228, 228, .95);
  border-radius: 28px;
  box-shadow: var(--premium-shadow-lg);
  overflow: hidden;
}

.auth-card::before,
.installer::before {
  content: "";
  display: block;
  height: 5px;
  margin: -1px -1px 24px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
}

.auth-brand img,
.installer header img {
  filter: drop-shadow(0 12px 18px rgba(7, 92, 79, .17));
}

.auth-brand h1,
.installer h1 {
  letter-spacing: -.045em;
}

.auth-card form,
.installer form {
  gap: 16px;
}

.auth-card button,
.installer button[type="submit"] {
  width: 100%;
  min-height: 49px;
  font-size: 15px;
}

.store-body {
  background:
    radial-gradient(circle at 100% 0, rgba(9, 185, 208, .08), transparent 30rem),
    linear-gradient(180deg, #f8fbfb, #f2f7f6 46%, #f8fbfb);
}

.store-header {
  border-bottom: 1px solid rgba(215, 228, 228, .86);
  background: rgba(255, 255, 255, .90);
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow: 0 10px 32px rgba(20, 56, 68, .055);
}

.store-brand img {
  padding: 4px;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(20, 56, 68, .10);
}

.store-search {
  border-radius: 15px;
  box-shadow: inset 0 0 0 1px rgba(215, 228, 228, .95), var(--premium-shadow-sm);
}

.store-category-nav a {
  border-radius: 999px;
  transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.store-category-nav a.active,
.store-category-nav a:hover {
  background: #edf8f5;
  box-shadow: inset 0 0 0 1px rgba(7, 92, 79, .12);
}

.store-hero {
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 30px;
  box-shadow: var(--premium-shadow-lg);
}

.store-hero .store-primary-button {
  min-height: 48px;
}

.store-benefits article,
.store-category-grid a,
.store-product-card,
.store-checkout-card,
.store-order-summary {
  background: rgba(255, 255, 255, .96);
}

.store-product-card {
  border-radius: 22px;
  overflow: hidden;
}

.store-product-buy button,
.store-cart-footer .store-primary-button,
.store-order-summary > button {
  min-height: 46px;
}

.store-cart {
  box-shadow: -24px 0 70px rgba(20, 56, 68, .18);
}

.store-footer {
  border: 1px solid rgba(215, 228, 228, .88);
  border-radius: 26px;
  box-shadow: var(--premium-shadow-md);
}

.notification-item.unread {
  border: 1px solid rgba(7, 92, 79, .09);
  box-shadow: 0 8px 24px rgba(20, 56, 68, .045);
}

.connection-status {
  border: 1px solid rgba(255, 255, 255, .20);
  backdrop-filter: blur(12px);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 238px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: min(86vw, 310px);
    box-shadow: 24px 0 70px rgba(5, 47, 42, .26);
  }

  .main-content {
    padding-inline: 16px;
    padding-bottom: calc(98px + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 72px;
    padding-block: 10px;
  }

  .menu-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #fff;
    color: var(--brand-primary);
  }

  .mobile-nav,
  .store-mobile-nav {
    border-top: 1px solid rgba(215, 228, 228, .92);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 -10px 30px rgba(20, 56, 68, .09);
    backdrop-filter: blur(18px) saturate(145%);
  }
}

@media (max-width: 640px) {
  .page-actions {
    align-items: stretch;
  }

  .action-group {
    width: 100%;
  }

  .action-group > *,
  .action-group form,
  .action-group form button {
    min-width: 0;
  }

  .panel,
  .welcome-card,
  .store-checkout-card,
  .store-order-summary {
    border-radius: 19px;
  }

  .welcome-card {
    padding: 23px 20px;
  }

  .stats-grid article {
    min-height: 106px;
  }

  .responsive-table {
    margin-inline: -2px;
    border-radius: 14px;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .store-hero {
    border-radius: 24px;
  }

  .store-product-card {
    border-radius: 19px;
  }

  .auth-card,
  .installer {
    border-radius: 22px;
  }
}

@media (max-width: 390px) {
  .main-content,
  .store-main {
    padding-inline: 12px;
  }

  .topbar {
    gap: 8px;
  }

  .topbar-title small {
    display: none;
  }

  .stats-grid,
  .system-health-summary {
    grid-template-columns: 1fr;
  }

  .action-group {
    display: grid;
    grid-template-columns: 1fr;
  }

  .action-group > *,
  .action-group form button {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
