body {
  font-family: "Inter", sans-serif;
}

.app-shell-header,
.app-shell-sidebar {
  background-color: #0f172a;
}

.theme-toggle-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
}

.nav-item {
  cursor: pointer;
}

.nav-item-active {
  background-color: rgb(6 78 59);
  color: rgb(52 211 153);
  border-color: rgb(16 185 129 / 0.5);
}

body.light-theme {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

body.light-theme .bg-slate-950 {
  background-color: #f1f5f9 !important;
}

body.light-theme .bg-slate-900,
body.light-theme .bg-slate-900\/90 {
  background-color: #ffffff !important;
}

body.light-theme .bg-slate-900\/95,
body.light-theme .app-shell-header,
body.light-theme .app-shell-sidebar {
  background-color: #ffffff !important;
}

body.light-theme .bg-slate-800 {
  background-color: #f8fafc !important;
}

body.light-theme .bg-slate-800\/60,
body.light-theme .bg-slate-900\/60 {
  background-color: rgba(255, 255, 255, 0.96) !important;
}

body.light-theme .border-slate-800,
body.light-theme .border-slate-700 {
  border-color: #cbd5e1 !important;
}

body.light-theme .app-shell-main {
  background-color: #f8fafc !important;
}

body.light-theme .text-slate-200 {
  color: #0f172a !important;
}

body.light-theme .text-slate-500 {
  color: #475569 !important;
}

body.light-theme .text-slate-300 {
  color: #334155 !important;
}

body.light-theme .nav-item-active {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  border-color: #6ee7b7 !important;
}

body.light-theme input,
body.light-theme select {
  color: #0f172a !important;
}

body.light-theme input::placeholder {
  color: #64748b !important;
}

body.light-theme .receta-status-ok {
  background-color: #dcfce7 !important;
  color: #14532d !important;
  border-color: #16a34a !important;
}

body.light-theme .receta-status-error {
  background-color: #fee2e2 !important;
  color: #7f1d1d !important;
  border-color: #dc2626 !important;
}

body:not(.light-theme) .receta-status-ok {
  background-color: rgb(6 78 59 / 0.5) !important;
  color: #bbf7d0 !important;
  border-color: #15803d !important;
}

body:not(.light-theme) .receta-status-error {
  background-color: rgb(127 29 29 / 0.5) !important;
  color: #fecaca !important;
  border-color: #b91c1c !important;
}

body.light-theme #recetaProductoContentTemplate + * .bg-black,
body.light-theme .bg-black {
  background-color: #000000 !important;
}

body.light-theme .receta-input {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

body.light-theme .receta-material-nombre {
  color: #0f172a !important;
}

body.light-theme .receta-material-meta {
  color: #334155 !important;
}

body.light-theme .receta-cantidad-real {
  color: #0f766e !important;
}

body.light-theme .receta-hero,
body.light-theme .producto-hero {
  background: linear-gradient(90deg, #064e3b 0%, #0f172a 50%, #065f46 100%) !important;
}

body.light-theme .receta-metric,
body.light-theme .producto-card,
body.light-theme .producto-empty,
body.light-theme .receta-table-head {
  background-color: transparent;
}

body.light-theme .receta-metric {
  background: linear-gradient(135deg, #064e3b 0%, #0f172a 100%) !important;
}

body.light-theme .receta-table-head {
  background: linear-gradient(90deg, #064e3b 0%, #0f172a 50%, #064e3b 100%) !important;
}

body.light-theme .producto-card,
body.light-theme .producto-empty {
  background: #ffffff !important;
}

body.light-theme .producto-card-meta {
  background-color: #ffffff !important;
  border-color: #dbe4f0 !important;
}

.producto-card {
  cursor: pointer;
}

.producto-card span {
  white-space: nowrap;
}

.producto-card-check-ui {
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.producto-card-check input:checked + .producto-card-check-ui {
  background-color: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.producto-card-check input:checked + .producto-card-check-ui::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.4rem;
  height: 0.7rem;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -58%) rotate(45deg);
}

.producto-card-selected {
  border-color: rgb(16 185 129 / 0.95) !important;
  box-shadow: 0 0 0 2px rgb(16 185 129 / 0.35), 0 18px 40px rgb(15 23 42 / 0.24);
  transform: translateY(-2px);
}

body.light-theme .producto-card {
  border-color: #dbe4f0 !important;
  box-shadow: 0 18px 40px rgba(148, 163, 184, 0.14);
}

body.light-theme .producto-card-selected {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22), 0 20px 44px rgba(15, 23, 42, 0.10) !important;
}

body.light-theme .producto-card-check-ui {
  background-color: #ffffff;
  border-color: rgba(16, 185, 129, 0.75);
}

body.light-theme .producto-card .text-slate-100,
body.light-theme .producto-card .text-slate-300,
body.light-theme .producto-card .text-slate-400,
body.light-theme .producto-card .text-slate-500 {
  color: #0f172a !important;
}

body.light-theme .producto-card .border-slate-700,
body.light-theme .producto-card .border-slate-800 {
  border-color: #dbe4f0 !important;
}

.categoria-group {
  background-color: #0f172a;
  border-color: #334155;
}

.categoria-chip {
  background-color: #1e293b;
  color: #e2e8f0;
  border-color: #475569;
}

.categoria-chip:hover {
  background-color: #1e293b;
}

.categoria-chip-input {
  background-color: #0f172a;
  border-color: #64748b;
  color: #94a3b8;
}

.categoria-chip.is-selected {
  background-color: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.9);
  color: #ecfdf5;
}

.categoria-chip-input:checked {
  background-color: #10b981;
  border-color: #10b981;
  box-shadow: inset 0 0 0 3px #0f172a;
}

body.light-theme .categoria-group {
  background-color: #ffffff !important;
  border-color: rgb(52 211 153 / 0.6) !important;
}

body.light-theme .categoria-chip {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: rgb(52 211 153 / 0.7) !important;
}

body.light-theme .categoria-chip:hover {
  background-color: #ecfdf5 !important;
}

body.light-theme .categoria-chip-input {
  background-color: #ffffff !important;
  border-color: rgb(16 185 129 / 0.8) !important;
  color: #10b981 !important;
}

body.light-theme .categoria-chip.is-selected {
  background-color: #d1fae5 !important;
  border-color: rgb(16 185 129 / 0.95) !important;
  color: #065f46 !important;
}

body.light-theme .categoria-chip-input:checked {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
  box-shadow: inset 0 0 0 3px #ffffff;
}

.receta-materiales-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.receta-material-row + .receta-material-row td {
  border-top: 1px solid rgb(51 65 85);
}

.receta-table-message {
  text-align: center;
}

@media (max-width: 1023px) {
  .receta-materiales-table {
    table-layout: auto;
  }

  .receta-materiales-head th {
    white-space: normal;
    line-height: 1.35;
  }

  .receta-material-cell {
    min-width: 0;
  }

  .receta-material-cell input {
    min-height: 42px;
  }
}

@media (max-width: 767px) {
  .app-shell-sidebar {
    top: calc(72px + 30px);
    bottom: 0;
    height: auto;
  }

  .app-shell-sidebar nav {
    padding-top: 0;
  }

  .app-shell-sidebar .nav-item {
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
  }

  .receta-materiales-table-shell {
    overflow: visible;
  }

  .receta-materiales-table-wrap {
    overflow: visible;
  }

  .receta-materiales-table,
  .receta-materiales-body,
  .receta-material-row,
  .receta-material-cell {
    display: block;
    width: 100%;
  }

  .receta-materiales-head {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .receta-material-row {
    padding: 0.5rem 0;
  }

  .receta-material-row + .receta-material-row {
    border-top: 1px solid rgb(51 65 85);
  }

  .receta-material-row + .receta-material-row td {
    border-top: 0;
  }

  .receta-material-cell {
    display: grid;
    grid-template-columns: minmax(120px, 42%) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem;
  }

  .receta-material-cell::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgb(148 163 184);
  }

  .receta-material-cell:first-child {
    align-items: start;
  }

  .receta-material-nombre {
    font-size: 0.90rem;
    font-weight: 700;
    color: #10b981;
  }

  .receta-material-cell input,
  .receta-material-cell .cantidad-real,
  .receta-material-cell > div {
    width: 100%;
  }

  .receta-table-message {
    display: block;
    width: 100%;
    padding: 2rem 1rem;
  }
}

body.light-theme .receta-material-row + .receta-material-row {
  border-top-color: #cbd5e1;
}

body.light-theme .receta-material-row + .receta-material-row td {
  border-top-color: #cbd5e1;
}

body.light-theme .receta-material-cell::before {
  color: #475569;
}

@media (max-width: 767px) {
  body.light-theme .receta-material-nombre {
    color: #059669 !important;
  }
}

.cotizacion-banner {
  width: 100%;
  max-width: 1200px;
  overflow: hidden;
  border-radius: 12px;
  background-color: #121e2d;
}

.cotizacion-banner-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
}

.cotizacion-cell {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #ffffff;
}

.cotizacion-cell-producto {
  text-align: center;
}

.cotizacion-cell-thumb {
  justify-content: center;
}

.cotizacion-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  color: #94a3b8;
  margin-bottom: 8px;
  font-weight: 600;
}

.cotizacion-value {
  font-size: 1.1rem;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.15;
}

.cotizacion-value-id {
  font-size: 0.88rem;
}

.cotizacion-value-categorias {
  font-size: 0.8rem;
  line-height: 1.2;
}

.cotizacion-product-thumb {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border-radius: 10px;
}

.cotizacion-product-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
}

.cotizacion-product-photo {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.cotizacion-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
  background-color: #1e293b;
  color: #94a3b8;
  font-size: 0.68rem;
}

.cotizacion-cell-input {
  align-items: stretch;
}

.cotizacion-input-field {
  background-color: #1e293b;
  border: 1px solid #2c3e50;
  border-radius: 6px;
  padding: 7px 8px;
  color: #ffffff;
  width: 50%;
  outline: none;
  margin: 0 auto;
  text-align: center;
}

.cotizacion-input-field::placeholder {
  color: #475569;
}

.cotizacion-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
}

.cotizacion-close-btn:hover {
  color: #ef4444;
}

.cotizacion-toolbar {
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.82) 0%, rgba(15, 23, 42, 0.96) 100%);
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.04);
}

.cotizacion-toolbar-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cotizacion-toolbar-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.cotizacion-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cotizacion-toolbar-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.cotizacion-toolbar-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #334155;
  border-radius: 12px;
  background-color: rgba(30, 41, 59, 0.82);
  padding: 0 14px;
  color: #e2e8f0;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cotizacion-toolbar-input::placeholder {
  color: #64748b;
}

.cotizacion-toolbar-input:focus {
  border-color: rgba(52, 211, 153, 0.8);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
  background-color: rgba(30, 41, 59, 0.96);
}

.cotizacion-toolbar-select {
  appearance: none;
}

.cotizacion-toolbar-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cotizacion-toolbar-btn {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 0.92rem;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.cotizacion-toolbar-btn:hover {
  transform: translateY(-1px);
}

.cotizacion-toolbar-btn-primary {
  border: 1px solid transparent;
  background-color: #10b981;
  color: #052e26;
}

.cotizacion-toolbar-btn-primary:hover {
  background-color: #34d399;
}

.cotizacion-toolbar-btn-secondary {
  border: 1px solid #334155;
  background-color: transparent;
  color: #cbd5e1;
}

.cotizacion-toolbar-btn-secondary:hover {
  border-color: rgba(52, 211, 153, 0.7);
  color: #6ee7b7;
  background-color: rgba(16, 185, 129, 0.06);
}

.cotizacion-header-row {
  display: none;
}

@media (max-width: 899px) {
  .cotizacion-header-row {
    display: none !important;
  }

  .cotizacion-banner {
    border-radius: 16px;
  }

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

  .cotizacion-cell,
  .cotizacion-close-btn {
    min-width: 0;
  }

  .cotizacion-cell {
    align-items: flex-start;
    text-align: left;
    padding: 12px;
  }

  .cotizacion-cell::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #10b981;
  }

  .cotizacion-cell-producto,
  .cotizacion-cell-thumb {
    align-items: center;
    text-align: center;
  }

  .cotizacion-cell-producto::before,
  .cotizacion-cell-thumb::before {
    width: 100%;
    text-align: center;
  }

  .cotizacion-cell-input {
    align-items: flex-start;
  }

  .cotizacion-input-field {
    width: 100%;
    margin: 0;
    text-align: left;
  }

  .cotizacion-close-btn {
    min-height: 46px;
    width: 100%;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
  }
}

@media (min-width: 640px) and (max-width: 899px) {
  .cotizacion-banner-grid {
    grid-template-columns: minmax(0, 1.3fr) 84px minmax(0, 0.8fr) minmax(0, 1fr) 48px;
    align-items: center;
  }

  .cotizacion-cell {
    padding: 10px 10px;
  }

  .cotizacion-cell::before {
    display: none;
  }

  .cotizacion-cell-producto {
    align-items: flex-start;
    text-align: left;
  }

  .cotizacion-cell-thumb {
    align-items: center;
    text-align: center;
  }

  .cotizacion-product-name {
    font-size: 0.92rem;
    line-height: 1.2;
  }

  .cotizacion-cell-mobile-hidden {
    display: none;
  }

  .cotizacion-cell-input {
    padding: 10px 6px;
  }

  .cotizacion-input-field {
    width: 100%;
    min-height: 38px;
    margin: 0;
    text-align: center;
  }

  .cotizacion-close-btn {
    min-height: 38px;
    width: 38px;
    border-top: none;
    justify-self: center;
  }
}

@media (max-width: 639px) {
  .cotizacion-toolbar {
    padding: 0.9rem !important;
  }

  .cotizacion-toolbar-actions {
    gap: 8px;
  }

  .cotizacion-toolbar-btn {
    width: 100%;
  }

  .cotizacion-banner-grid {
    grid-template-columns: minmax(0, 1.1fr) 64px minmax(0, 1fr) 36px;
    align-items: center;
  }

  .cotizacion-cell {
    padding: 8px 8px;
  }

  .cotizacion-cell::before {
    display: none;
  }

  .cotizacion-cell-producto,
  .cotizacion-cell-thumb {
    align-items: center;
    text-align: left;
  }

  .cotizacion-cell-producto {
    align-items: flex-start;
  }

  .cotizacion-product-thumb {
    width: 46px;
    height: 46px;
  }

  .cotizacion-product-name {
    font-size: 0.92rem;
    line-height: 1.15;
  }

  .cotizacion-cell-mobile-hidden {
    display: none;
  }

  .cotizacion-cell-input {
    padding: 8px 4px;
  }

  .cotizacion-input-field {
    width: 100%;
    min-height: 36px;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .cotizacion-close-btn {
    min-height: 36px;
    width: 36px;
    padding: 0;
    border-top: none;
    justify-self: center;
  }

  .cotizacion-banner {
    border-radius: 14px;
  }
}

body.light-theme .cotizacion-toolbar {
  background: #ffffff !important;
  border-color: #bbf7d0 !important;
  box-shadow: none;
}

body.light-theme .cotizacion-toolbar-label {
  color: #065f46 !important;
}

body.light-theme .cotizacion-toolbar-input {
  background-color: #ffffff !important;
  border-color: #a7f3d0 !important;
  color: #0f172a !important;
}

body.light-theme .cotizacion-toolbar-input::placeholder {
  color: #0f172a !important;
  opacity: 1;
}

body.light-theme .cotizacion-toolbar-input:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14) !important;
  background-color: #ffffff !important;
}

body.light-theme .cotizacion-toolbar-btn-secondary {
  border-color: #a7f3d0 !important;
  background-color: #ffffff !important;
  color: #065f46 !important;
}

body.light-theme .cotizacion-toolbar-btn-secondary:hover {
  border-color: #10b981 !important;
  color: #047857 !important;
  background-color: #ecfdf5 !important;
}

body.light-theme .cotizacion-banner {
  background-color: #ffffff !important;
}

body.light-theme .cotizacion-label {
  color: #059669 !important;
}

body.light-theme .cotizacion-value,
body.light-theme .cotizacion-product-name {
  color: #0f172a !important;
}

body.light-theme .cotizacion-product-thumb,
body.light-theme .cotizacion-product-photo {
  box-shadow: none;
}

body.light-theme .cotizacion-thumb-empty {
  border-color: #a7f3d0 !important;
  background-color: #f0fdf4 !important;
  color: #047857 !important;
}

body.light-theme .cotizacion-input-field {
  background-color: #ffffff !important;
  border-color: #a7f3d0 !important;
  color: #0f172a !important;
}

body.light-theme .cotizacion-input-field::placeholder {
  color: #10b981 !important;
  opacity: 0.7;
}

body.light-theme .cotizacion-close-btn {
  color: #059669 !important;
}

@media (max-width: 899px) {
  body.light-theme .cotizacion-close-btn {
    border-top-color: rgba(16, 185, 129, 0.16) !important;
  }
}

@media (min-width: 900px) {
  .cotizacion-toolbar-shell {
    flex-direction: row;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
  }

  .cotizacion-toolbar-fields {
    grid-template-columns: minmax(0, 1.8fr) minmax(170px, 0.8fr);
    flex: 1;
  }

  .cotizacion-toolbar-actions {
    flex-direction: row;
    justify-content: flex-end;
    align-items: end;
  }

  .cotizacion-toolbar-btn {
    min-width: 190px;
  }

  .cotizacion-header-row {
    display: grid;
    grid-template-columns: 1fr 80px 1.5fr 1.2fr 1fr 2fr 40px;
    gap: 0;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 8px;
    color: #059669;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
  }

  .cotizacion-banner-grid {
    grid-template-columns: 1fr 80px 1.5fr 1.2fr 1fr 2fr 40px;
  }

  .cotizacion-cell {
    border-right: none;
  }

  .cotizacion-close-btn {
    min-height: 100%;
  }
}
