:root {
  --bg: #121311;
  --panel: #1d1e1a;
  --panel-2: #262721;
  --ink: #f4f0e7;
  --muted: #a6a095;
  --line: #3a3932;
  --green: #3ddc84;
  --green-dark: #103a25;
  --gold: #e5b34a;
  --danger: #e26363;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, .primary, .ghost, .success, .pill { min-height: 42px; border-radius: var(--radius); border: 1px solid var(--line); cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
input, textarea, select { width: 100%; background: #171815; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; }
textarea { resize: vertical; line-height: 1.45; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 650; }
h1, h2, h3, p { margin-top: 0; }

.topbar { position: sticky; top: 0; z-index: 50; min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; background: rgba(18, 19, 17, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.brand { font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.brand span { color: var(--muted); font-weight: 700; font-size: 12px; margin-left: 6px; }
.topnav { display: flex; align-items: center; gap: 8px; }
.topnav a, .topnav button { background: transparent; color: var(--muted); border: 1px solid transparent; padding: 9px 11px; }
.topnav a.active, .topnav a:hover, .topnav button:hover { color: var(--ink); border-color: var(--line); background: var(--panel); }
.topnav form { margin: 0; }
.shell { min-height: calc(100vh - 62px); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.login-panel { width: min(440px, 100%); display: grid; gap: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.login-panel h1 { font-size: clamp(34px, 9vw, 56px); line-height: .95; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 15px; }
.alert { border: 1px solid var(--line); background: var(--panel-2); padding: 12px 14px; border-radius: var(--radius); }
.alert.error { border-color: var(--danger); color: #ffd7d7; }

.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--green); color: #08220f; border-color: var(--green); padding: 10px 15px; font-weight: 800; }
.ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--panel); color: var(--ink); padding: 10px 15px; }
.success { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #25d366; color: #06210f; border-color: #25d366; padding: 10px 15px; font-weight: 800; }
.pill { background: var(--panel); color: var(--ink); padding: 9px 13px; border-radius: 999px; }
.count { border-color: var(--green); color: var(--green); }
.hidden, [hidden] { display: none !important; }

.reserve-app { position: relative; min-height: calc(100vh - 62px); overflow: hidden; }
.mobile-actions { position: fixed; top: 74px; right: 16px; left: 16px; z-index: 25; display: flex; justify-content: flex-end; gap: 8px; pointer-events: none; }
.mobile-actions button { pointer-events: auto; }
.carousel { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 72px 0 88px; }
.carousel::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; padding: 0 18px; }
.gcard { position: relative; width: min(100%, 500px); height: min(100%, 610px); min-height: 480px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 22px; cursor: pointer; user-select: none; }
.gcard.sel { border-color: var(--green); background: linear-gradient(180deg, var(--green-dark), var(--panel) 56%); }
.gcard .cat { color: var(--gold); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; padding-right: 46px; }
.gimg { width: 100%; height: 36%; min-height: 128px; object-fit: contain; background: #fff; border-radius: var(--radius); }
.gnophoto { display: grid; place-items: center; background: var(--panel-2); color: var(--muted); border: 1px dashed var(--line); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
.tipo { color: var(--muted); }
.modelo { font-weight: 900; font-size: clamp(28px, 8vw, 44px); line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.marca { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.notas { color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.checkmark { position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); color: transparent; }
.gcard.sel .checkmark { color: #06210f; background: var(--green); border-color: var(--green); }
.foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.serie { color: var(--muted); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.qty { font-size: 28px; font-weight: 900; text-align: right; }
.qty small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.stepper { display: none; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px; }
.gcard.sel .stepper.multi { display: flex; }
.stepper button { width: 34px; min-height: 34px; border-radius: 50%; background: var(--panel); color: var(--ink); }
.stepper .n { min-width: 18px; text-align: center; font-weight: 900; }
.navhint { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 20; pointer-events: none; text-align: center; color: var(--muted); }
.navhint #catLabel { color: var(--gold); margin-top: 2px; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.panel-overlay { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; text-transform: uppercase; letter-spacing: .04em; }
.panel-foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 22%); }
.panel-foot > * { flex: 1; }
.panel-foot.wrap { flex-wrap: wrap; }
.scroll { flex: 1; overflow-y: auto; padding: 16px 16px 118px; }
.lcat { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; padding: 16px 0 6px; }
.lrow { display: flex; align-items: center; gap: 10px; min-height: 58px; border-bottom: 1px solid var(--line); cursor: pointer; }
.box { width: 30px; height: 30px; border: 2px solid var(--muted); border-radius: var(--radius); display: grid; place-items: center; color: transparent; flex: 0 0 auto; }
.lrow.sel .box { color: #06210f; background: var(--green); border-color: var(--green); }
.lrow.sel .lname { color: var(--green); }
.lmain { min-width: 0; flex: 1; }
.lname { font-weight: 750; overflow-wrap: anywhere; }
.lsub { color: var(--muted); font-size: 12px; }
.lqty { color: var(--muted); font-weight: 800; }
.lstep { display: flex; align-items: center; gap: 6px; }
.lstep button { width: 32px; min-height: 32px; border-radius: 50%; background: var(--panel); color: var(--ink); visibility: hidden; }
.lrow.sel .lstep button { visibility: visible; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-content: start; }
.span-2 { grid-column: 1 / -1; }
.doc-preview { background: #fff; color: #111; border-radius: var(--radius); padding: 16px; font-size: 12px; line-height: 1.4; }
.doc-preview h3 { margin: 0 0 8px; text-transform: uppercase; }
.doc-preview table { width: 100%; border-collapse: collapse; font-size: 11px; }
.doc-preview th, .doc-preview td { border: 1px solid #999; padding: 4px 6px; text-align: left; vertical-align: top; }
.doc-preview th { background: #eee; }

.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.month-nav button { width: 46px; background: var(--panel); color: var(--ink); font-size: 28px; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.caldow { color: var(--muted); text-align: center; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.calday { aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: var(--radius); display: grid; place-items: center; background: var(--panel); font-weight: 800; }
.calday.empty { background: transparent; border: 0; }
.calday.today { outline: 2px solid var(--gold); outline-offset: -2px; }
.calday.full { background: var(--green); color: #06210f; border-color: var(--green); }
.calday.half { background: var(--green-dark); color: var(--green); border-color: var(--green); }
.calday.has { cursor: pointer; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 12px; padding: 14px 0; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--green); }
.legend .full { background: var(--green); }
.legend .half { background: var(--green-dark); }
.detail-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.detail-card h3 { margin-bottom: 6px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 92px; z-index: 90; background: #392b12; border: 1px solid var(--gold); color: var(--ink); border-radius: var(--radius); padding: 14px 16px; white-space: pre-wrap; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(0,0,0,.92); }
.lightbox img { max-width: 100vw; max-height: 100vh; background: #fff; object-fit: contain; }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 18px; }
.section-head h1 { margin: 0; font-size: clamp(30px, 6vw, 52px); text-transform: uppercase; line-height: 1; }
.admin-app { max-width: 1180px; margin: 0 auto; padding: 28px 18px 60px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button { background: var(--panel); color: var(--muted); padding: 10px 14px; }
.tabs button.active { color: #06210f; background: var(--green); border-color: var(--green); font-weight: 800; }
.admin-tab { display: none; }
.admin-tab.active { display: block; }
.admin-form, .filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.admin-form.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-form .wide { grid-column: span 2; }
.form-actions { display: flex; align-items: end; gap: 10px; }
.admin-list { display: grid; gap: 10px; }
.admin-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.admin-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.admin-card h3 { margin: 0; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); border-radius: 999px; padding: 4px 8px; font-size: 12px; }
.badge.green { color: var(--green); border-color: var(--green); }
.badge.red { color: #ffc4c4; border-color: var(--danger); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: var(--radius); }
.photo-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.empty-state { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 40px; }
.print-body { background: #fff; color: #111; }
.print-sheet { max-width: 8.5in; margin: 0 auto; padding: 24px; font-family: Arial, sans-serif; }
.print-sheet h1 { font-size: 18px; text-transform: uppercase; }
.print-sheet table { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-sheet th, .print-sheet td { border: 1px solid #111; padding: 5px 7px; text-align: left; vertical-align: top; }
.print-box { margin-top: 16px; border: 1px solid #111; min-height: 72px; padding: 8px; }
.signatures { display: flex; gap: 44px; margin-top: 48px; }
.signatures div { flex: 1; border-top: 1px solid #111; text-align: center; padding-top: 5px; }
.signatures span { display: block; font-size: 12px; }
.signatures.single { width: 50%; }
.print-actions { text-align: right; margin-bottom: 12px; }
.print-actions button { background: #111; color: #fff; padding: 9px 14px; }

@media (max-width: 760px) {
  .topbar { align-items: stretch; flex-direction: column; }
  .topnav { justify-content: space-between; }
  .mobile-actions { top: 116px; }
  .carousel { padding-top: 90px; }
  .gcard { min-height: 520px; padding: 18px; }
  .form-grid, .admin-form, .admin-form.compact, .filters { grid-template-columns: 1fr; }
  .admin-form .wide, .span-2 { grid-column: auto; }
  .section-head { align-items: start; flex-direction: column; }
  .panel-foot { flex-direction: column; }
  .signatures, .signatures.single { width: auto; flex-direction: column; gap: 36px; }
}

@media print {
  .print-actions { display: none; }
  .print-sheet { padding: 0; }
}

