/* ===== Panel de administración ===== */
:root { --navy: #0a1a3f; --navy-soft: #14306b; --gold: #b08d57; --ink: #1c2434; --muted: #667085; --line: #e4e7ec; --bg: #f3f4f6; --danger: #b42318; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: Roboto, "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--navy-soft); text-decoration: none; }
h1, h2, p { margin: 0; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
.ic { flex: none; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.side { position: fixed; inset: 0 auto 0 0; width: 236px; padding: 20px 14px; background: var(--navy); color: #fff; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .85rem; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 6px; color: rgba(255, 255, 255, .82); font-weight: 500; font-size: .92rem; }
.side nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side nav a.on { background: var(--gold); color: #fff; }
.side hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .14); margin: 14px 0; }
.pill { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: #d92d20; font-size: .72rem; }
.main { margin-left: 236px; padding: 28px 32px 90px; max-width: 1240px; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 1.5rem; }
.page-head small { font-size: .9rem; font-weight: 400; color: var(--muted); margin-left: 6px; }
.head-actions { display: flex; gap: 8px; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 22px; margin-bottom: 18px; }
.box h2 { font-size: 1.05rem; margin-bottom: 16px; }
.box h2 small { font-weight: 400; color: var(--muted); }
.box.empty { text-align: center; padding: 48px 20px; display: grid; gap: 14px; justify-items: center; color: var(--muted); }
.hint { font-size: .82rem; color: var(--muted); margin: 8px 0; }
.alert { padding: 11px 16px; border-radius: 6px; margin-bottom: 16px; font-weight: 500; font-size: .92rem; }
.alert.ok { background: #e3f6ec; color: #116237; }
.alert.err { background: #fde8e6; color: #9b1c12; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; border: 1px solid #cfd4dc; border-radius: 6px; background: #fff; color: var(--ink); font-weight: 500; font-size: .9rem; }
.btn:hover { border-color: var(--navy-soft); }
.btn.primary { background: var(--navy-soft); border-color: var(--navy-soft); color: #fff; font-weight: 700; }
.btn.primary:hover { background: var(--navy); }
.btn.small { padding: 7px 12px; font-size: .82rem; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #475467; }
.icon-btn:hover { border-color: var(--navy-soft); color: var(--navy-soft); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* Tablas */
.table-wrap { overflow-x: auto; }
.box.table-wrap { padding: 0; }
table { width: 100%; border-collapse: collapse; }
.list th { text-align: left; padding: 12px 14px; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list small { display: block; color: var(--muted); font-size: .78rem; }
.list .t { font-weight: 700; color: var(--ink); }
.list .t:hover { color: var(--navy-soft); }
.thumb img { width: 74px; height: 54px; object-fit: cover; border-radius: 4px; background: var(--bg); }
.nowrap { white-space: nowrap; }
.actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.actions form { margin: 0; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.tag.ok { background: #e3f6ec; color: #116237; }
.tag.warn { background: #fdf0d5; color: #8a5a00; }
.switch { position: relative; width: 42px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: #cfd4dc; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: #18794e; }
.switch.on i { left: 21px; }

/* Formularios */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px 16px; }
.col-2 { grid-column: span 2; } .col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; } .col-8 { grid-column: span 8; } .col-12 { grid-column: span 12; }
label { display: block; font-size: .82rem; font-weight: 500; color: #344054; }
input[type=text], input[type=number], input[type=email], input[type=url], input[type=password], select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #cfd4dc; border-radius: 6px; background: #fff; font: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(20, 48, 107, .22); border-color: var(--navy-soft); }
textarea { resize: vertical; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px 14px; margin-bottom: 16px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: .9rem; padding: 4px 0; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--navy-soft); }
.variants-edit { min-width: 620px; margin-bottom: 12px; }
.variants-edit th { text-align: left; font-size: .76rem; color: var(--muted); font-weight: 500; padding: 0 6px 2px 0; }
.variants-edit td { padding: 0 6px 8px 0; }
.variants-edit td:first-child { width: 34%; }
.variants-edit input { margin-top: 0; }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 10px; }
.map { height: 360px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 14px; z-index: 1; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.photo { border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: .8rem; display: grid; gap: 4px; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--bg); }
.photo .ord { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.photo .ord input { width: 70px; margin: 0; padding: 4px 8px; }
.photo .del { color: var(--danger); }
.photo span { color: var(--muted); }
.drop { position: relative; display: grid; justify-items: center; gap: 4px; padding: 26px 16px; border: 2px dashed #cfd4dc; border-radius: 8px; text-align: center; color: var(--muted); cursor: pointer; font-weight: 400; }
.drop:hover { border-color: var(--navy-soft); color: var(--navy-soft); }
.drop strong { color: var(--ink); font-size: .95rem; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.save-bar { position: fixed; left: 236px; right: 0; bottom: 0; z-index: 500; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 32px; background: #fff; border-top: 1px solid var(--line); }
.save-bar.inline { position: static; padding: 16px 0 0; border: 0; }

.logo-set { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.logo-preview { display: grid; place-items: center; min-width: 240px; min-height: 96px; padding: 16px 22px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .9rem; }
.logo-preview img { max-height: 64px; max-width: 260px; width: auto; }
.logo-preview span { display: inline-flex; align-items: center; gap: 10px; }
.logo-fields { flex: 1; min-width: 260px; }
input[type=file] { display: block; width: 100%; margin-top: 6px; padding: 8px; border: 1px dashed #cfd4dc; border-radius: 6px; background: #fff; font: inherit; }

.pw { position: relative; display: block; }
.pw input { padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; bottom: 3px; display: grid; place-items: center; width: 36px; height: 34px; border: 0; background: none; color: var(--muted); border-radius: 6px; }
.pw-eye:hover { color: var(--navy-soft); }
.pw-eye .off, .pw-eye.show .on { display: none; }
.pw-eye.show .off { display: inline; }
.user-row { display: grid; grid-template-columns: 1fr 1.4fr 1.2fr auto; gap: 12px; align-items: end; padding: 14px 0; border-bottom: 1px solid var(--line); }
.user-row:last-of-type { border-bottom: 0; }
.user-row .who strong { display: block; }
.user-row .who small { color: var(--muted); }
.user-row .actions { padding-bottom: 2px; }
.login-box .link-row { display: flex; justify-content: space-between; gap: 12px; font-size: .85rem; }
@media (max-width: 860px) { .user-row { grid-template-columns: 1fr; } .user-row .actions { justify-content: flex-start; } }

/* Mensajes */
.msg header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.msg header small { color: var(--muted); margin-left: 8px; }
.msg.unread { border-left: 4px solid #18794e; }
.msg-contact { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0; font-size: .88rem; }
.msg-body { color: #344054; }

/* Acceso */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #14306b, #060f28); }
.login-box { width: min(400px, 100%); display: grid; gap: 14px; padding: 32px 28px; background: #fff; border-radius: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.login-box h1 { font-size: 1.25rem; text-align: center; }
.login-logo { justify-self: center; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: var(--navy); color: #fff; }
.login-box .btn { width: 100%; padding: 12px; }
.login-box .hint { text-align: center; margin: 0; }
.login-box .alert { margin: 0; }

@media (max-width: 860px) {
  .side { position: static; width: auto; padding: 10px; }
  .side-brand { padding-bottom: 10px; }
  .side nav { display: flex; gap: 4px; overflow-x: auto; }
  .side nav a { white-space: nowrap; padding: 9px 12px; }
  .side hr { display: none; }
  .main { margin-left: 0; padding: 18px 14px 90px; }
  .save-bar { left: 0; padding: 10px 14px; }
  .grid > * { grid-column: span 12; }
}
