:root {
  --ink: #211d1a;
  --muted: #6f675f;
  --paper: #f7f3ed;
  --panel: #fffdfa;
  --line: #ded3c7;
  --copper: #b55836;
  --green: #2e6b53;
  --blue: #315f7d;
  --gold: #c69a3d;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(33, 29, 26, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(33, 29, 26, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: Georgia, "Times New Roman", serif;
}

button, input, select, textarea, .btn, .form-control, .form-select, .table {
  font-family: "Trebuchet MS", Verdana, sans-serif;
}

.gallery-nav {
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 237, 0.94);
  backdrop-filter: blur(12px);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-text {
  display: grid;
  line-height: 1.05;
}

.brand-text small {
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: .68rem;
  font-weight: 600;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: white;
  background: var(--ink);
  border-radius: 50%;
  font-size: .85rem;
}

.nav-link {
  border: 0;
  background: transparent;
}

.nav-link.active {
  color: var(--copper) !important;
  font-weight: 700;
}

.session-label {
  color: var(--muted);
  font-size: .9rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.catalog-hero {
  min-height: 360px;
  display: flex;
  align-items: end;
  padding: 5rem 0 2rem;
  color: white;
  background:
    linear-gradient(90deg, rgba(33, 29, 26, .92), rgba(33, 29, 26, .52)),
    linear-gradient(135deg, #81462f, #2e6b53 50%, #315f7d);
}

.catalog-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 5.4rem);
  line-height: .98;
}

.hero-subtitle {
  max-width: 760px;
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, .9);
  font-size: clamp(1.1rem, 2.2vw, 1.65rem);
  line-height: 1.25;
}

.eyebrow {
  margin-bottom: .75rem;
  color: var(--copper);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.catalog-hero .eyebrow {
  color: #f1c46b;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr minmax(150px, .45fr) minmax(150px, .45fr) auto;
  gap: .6rem;
  padding: .75rem;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .12);
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
  gap: .6rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, .92);
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.art-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.art-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 26px rgba(33, 29, 26, .08);
}

.art-image {
  display: block;
  font-size: 0;
  line-height: 0;
  color: rgba(255, 255, 255, .85);
  background:
    linear-gradient(135deg, rgba(181, 88, 54, .95), rgba(46, 107, 83, .88)),
    var(--copper);
}

.art-image:has(i) {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  font-size: 2.4rem;
  line-height: 1;
}

.image-open-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.art-image img {
  display: block;
  width: 100%;
  height: auto;
}

.art-card-body {
  padding: 1rem;
}

.art-card h3 {
  margin: 0 0 .35rem;
  font-size: 1.2rem;
}

.art-meta {
  color: var(--muted);
  font-size: .9rem;
}

.art-price {
  color: var(--green);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.workspace {
  width: min(1480px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0;
}

.workspace.narrow {
  width: min(880px, calc(100% - 2rem));
}

.workspace-header,
.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.workspace-header h2,
.panel-toolbar h3,
.stat-panel h3,
.checkout-panel h3 {
  margin: 0;
}

.admin-panel,
.stat-panel,
.checkout-panel,
.profile-panel,
.data-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, .92);
  padding: 1rem;
  box-shadow: 0 12px 26px rgba(33, 29, 26, .06);
}

.table {
  margin: 0;
}

.stock-control {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-width: 112px;
}

.stock-input {
  width: 72px;
}

.badge-type {
  color: white;
  background: var(--blue);
}

.badge-status {
  color: white;
  background: var(--green);
}

.badge-status.vendida {
  background: var(--copper);
}

.badge-status.apartada {
  background: var(--gold);
}

.badge-source {
  color: var(--ink);
  background: #eadfce;
}

.cart-items {
  display: grid;
  gap: .5rem;
  min-height: 90px;
  margin: 1rem 0;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .5rem;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: "Trebuchet MS", Verdana, sans-serif;
}

.request-work-summary,
.request-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.request-work-summary {
  padding: .85rem;
}

.optional-fields {
  padding: .85rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(247, 243, 237, .58);
}

.optional-fields .form-label {
  margin-bottom: .25rem;
  color: var(--muted);
  font-size: .78rem;
}

.optional-title {
  margin-bottom: .55rem;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.requests-list {
  display: grid;
  gap: 1rem;
}

.request-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(33, 29, 26, .06);
}

.request-thumb {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .85);
  background: linear-gradient(135deg, var(--copper), var(--green));
  font-size: 2.2rem;
}

.request-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.request-main {
  padding: 1rem;
}

.request-client {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .85rem;
  margin-top: .6rem;
  color: var(--muted);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: .9rem;
}

.request-client strong {
  color: var(--ink);
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

.receipt {
  border: 1px solid var(--line);
  padding: 1.2rem;
  background: white;
}

.image-viewer-modal .modal-content {
  background: var(--panel);
}

.image-viewer-modal .modal-body {
  padding: 0;
  background: #15110e;
}

.image-viewer-modal img {
  display: block;
  width: 100%;
  max-height: min(78vh, 900px);
  object-fit: contain;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(247, 243, 237, .62);
}

.about-content {
  display: grid;
  gap: 1.5rem;
}

.about-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, .92);
  padding: 1.5rem;
  box-shadow: 0 12px 26px rgba(33, 29, 26, .06);
}

.about-card h3 {
  margin: 0 0 .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.about-card h3 i {
  color: var(--copper);
}

.about-card p {
  margin: 0;
  line-height: 1.6;
}

.manual-section {
  margin-top: 1.25rem;
}

.manual-section h4 {
  margin: 0 0 .5rem;
  color: var(--green);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: .9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.manual-section ul {
  margin: 0;
  padding-left: 1.25rem;
}

.manual-section li {
  margin-bottom: .35rem;
  line-height: 1.55;
}

.about-card a {
  color: var(--copper);
  font-weight: 700;
  text-decoration: none;
}

.about-card a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .filter-bar,
  .filter-panel,
  .workspace-header,
  .panel-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-hero {
    min-height: 430px;
  }

  .request-card {
    grid-template-columns: 1fr;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #receiptBody,
  #receiptBody * {
    visibility: visible;
  }

  #receiptBody {
    position: fixed;
    inset: 0;
    background: white;
  }
}
