@import url('https://fonts.googleapis.com/css2?family=Marcellus&family=Jost:wght@300;400;500;600&display=swap');

:root {
  --onyx: #0f0e0c;
  --panel: #17140f;
  --panel-2: #1e1a13;
  --line: #2c2620;
  --gold: #c9a227;
  --gold-light: #e8cd7a;
  --wine: #8a2436;
  --ivory: #f5efe0;
  --muted: #9a927f;
  --bg: #f3efe6;
  --ok: #4c7a4f;
  --font-display: 'Marcellus', serif;
  --font-body: 'Jost', sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: #262119;
}
a { text-decoration: none; color: inherit; }

/* ---- Login ---- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #1c1712 0%, var(--onyx) 70%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 46px 38px;
  color: var(--ivory);
}
.login-card h1 {
  font-family: var(--font-display); color: var(--gold-light);
  font-size: 1.9rem; letter-spacing: 0.1em; text-align: center; margin: 0 0 6px;
}
.login-card .tag { text-align: center; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 30px; }

/* ---- Layout ---- */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--onyx);
  color: var(--ivory);
  padding: 26px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand {
  font-family: var(--font-display); color: var(--gold-light);
  font-size: 1.3rem; letter-spacing: 0.12em;
  padding: 0 26px 26px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 26px; font-size: 0.88rem;
  color: #c9c2b0; border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: var(--panel); color: var(--ivory); }
.sidebar nav a.active { background: var(--panel-2); color: var(--gold-light); border-left-color: var(--gold); }
.sidebar .sidebar-foot { padding: 20px 26px 0; margin-top: 20px; border-top: 1px solid var(--line); }
.sidebar .sidebar-foot a { padding: 10px 0; font-size: 0.82rem; color: var(--muted); }
.sidebar .sidebar-foot a:hover { color: var(--wine); }
.badge-count {
  background: var(--wine); color: #fff; font-size: 0.68rem;
  padding: 1px 7px; border-radius: 10px; margin-left: auto;
}

.main { flex-grow: 1; padding: 34px 42px; max-width: 1180px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 30px; flex-wrap: wrap; gap: 14px; }
.page-head h1 { font-family: var(--font-display); font-size: 2rem; margin: 0; }
.page-head .sub { color: #6b6355; font-size: 0.9rem; margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; font-size: 0.82rem; letter-spacing: 0.04em;
  border: 1px solid var(--onyx); background: var(--onyx); color: var(--ivory);
  cursor: pointer; transition: all 0.2s ease;
}
.btn:hover { background: #2b2620; }
.btn-outline { background: transparent; color: var(--onyx); }
.btn-outline:hover { background: var(--onyx); color: var(--ivory); }
.btn-danger { background: transparent; border-color: var(--wine); color: var(--wine); }
.btn-danger:hover { background: var(--wine); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1a1508; }
.btn-gold:hover { background: var(--gold-light); }
.btn-sm { padding: 7px 14px; font-size: 0.76rem; }

/* Touch-friendly adjustments */
.btn, .btn-sm {
  touch-action: manipulation;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  min-width: 44px;
  min-height: 44px;
}

.product-card button, #pos-quick-amounts button, #pos-pay-cash, #pos-pay-card {
  font-size: 1rem;
  padding: 12px 18px;
}

/* ---- Cards / tables ---- */
.card { background: #fff; border: 1px solid #e4dcc9; padding: 26px; margin-bottom: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 34px; }
.stat-card { background: #fff; border: 1px solid #e4dcc9; padding: 22px 24px; border-left: 3px solid var(--gold); }
.stat-card .num { font-family: var(--font-display); font-size: 2.2rem; color: var(--onyx); }
.stat-card .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: #8a8272; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: #8a8272; padding: 10px 12px; border-bottom: 2px solid #e4dcc9;
}
tbody td { padding: 12px; border-bottom: 1px solid #efe9db; vertical-align: middle; }
tbody tr:hover { background: #faf7f0; }
.thumb { width: 52px; height: 52px; object-fit: cover; border: 1px solid #e4dcc9; }
.thumb-empty { width: 52px; height: 52px; background: #f0ead9; border: 1px dashed #d8cfb6; }
.tag-pill { display: inline-block; padding: 3px 10px; font-size: 0.72rem; border-radius: 20px; background: #efe9db; color: #59503f; }
.tag-pill.gold { background: #f3e6bd; color: #7a5e10; }
.tag-pill.wine { background: #f3dde1; color: var(--wine); }
.tag-pill.ok { background: #e3ecdf; color: var(--ok); }
.row-actions { display: flex; gap: 8px; }
.empty-state { text-align: center; padding: 60px 20px; color: #9a9280; }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } .main { padding: 24px 18px; } .admin-shell { flex-direction: column; } .sidebar { width: 100%; height: auto; position: relative; } }
.field { margin-bottom: 18px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b6355; margin-bottom: 7px; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=date],
.field input[type=password], .field input[type=number], .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #d8cfb6; background: #fffdf8; font-family: var(--font-body); font-size: 0.92rem;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.field .hint { font-size: 0.78rem; color: #9a9280; margin-top: 5px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.current-image { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.current-image img { width: 90px; height: 90px; object-fit: cover; border: 1px solid #e4dcc9; }

.upload-drop {
  border: 2px dashed #d8cfb6; padding: 30px; text-align: center; color: #9a9280; margin-bottom: 20px; font-size: 0.9rem;
}

.gallery-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.gallery-admin-item { position: relative; border: 1px solid #e4dcc9; }
.gallery-admin-item img { width: 100%; height: 140px; object-fit: cover; display: block; }
.gallery-admin-item .cap { padding: 8px 10px; font-size: 0.78rem; color: #6b6355; display: flex; justify-content: space-between; align-items: center; gap: 6px; }

.flash-stack-admin { margin-bottom: 20px; }
.flash-admin { padding: 13px 18px; margin-bottom: 10px; font-size: 0.88rem; border-left: 3px solid var(--ok); background: #eef4ec; color: #365239; }
.flash-admin.error { border-left-color: var(--wine); background: #fbeced; color: var(--wine); }

.calendar-nav { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.calendar-nav select { padding: 8px 12px; border: 1px solid #d8cfb6; }

.mensaje-atencion { margin-top: 22px; padding-top: 16px; border-top: 1px solid #cbbd9f; }
.mensaje-canales, .mensaje-estado { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mensaje-estado { margin-top: 18px; }
.mensaje-estado label { font-weight: 500; }
.mensaje-estado select { padding: 10px; background: #fffaf0; color: #1a1815; border: 1px solid #8a754c; font: inherit; }
@media(max-width:600px) { .mensaje-canales > a { width: 100%; text-align: center; } .mensaje-estado label { width: 100%; } }

.instalacion-fotos-admin { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 18px; }
.instalacion-fotos-admin img { width: 100%; height: 140px; object-fit: contain; background: #171410; }
.instalacion-fotos-admin span { display: block; padding: 10px 0; }

.videos-admin-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: 24px; }
.video-admin-card { border: 1px solid #cbbd9f; padding: 18px; min-width: 0; }
.video-admin-card video { display: block; width: 100%; max-height: 280px; background: #171410; margin-bottom: 16px; }
