/* ===== Panel de administración =====
   Todas las reglas van dentro de .admin-shell para no chocar con los estilos del sitio,
   porque el panel se muestra con el encabezado y el pie de la página. */
: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); }
.admin-shell a { color: var(--navy-soft); text-decoration: none; }
.admin-shell h1, .admin-shell h2, .admin-shell p { margin: 0; }
.admin-shell img { max-width: 100%; display: block; }
.admin-shell button { font: inherit; cursor: pointer; }
.admin-shell .ic { flex: none; vertical-align: -3px; }
.admin-shell :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.admin-shell .side { position: sticky; top: 76px; align-self: flex-start; flex: none; height: calc(100vh - 76px); width: 236px; padding: 20px 14px; background: var(--navy); color: #fff; overflow-y: auto; }
.admin-shell .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; }
.admin-shell .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; }
.admin-shell .side nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-shell .side nav a.on { background: var(--gold); color: #fff; }
.admin-shell .side hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .14); margin: 14px 0; }
.admin-shell .pill { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: #d92d20; font-size: .72rem; }
.admin-shell .main { flex: 1; min-width: 0; padding: 28px 32px 40px; max-width: 1240px; }

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

.admin-shell .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; }
.admin-shell .btn:hover { border-color: var(--navy-soft); }
.admin-shell .btn.primary { background: var(--navy-soft); border-color: var(--navy-soft); color: #fff; font-weight: 700; }
.admin-shell .btn.primary:hover { background: var(--navy); }
.admin-shell .btn.small { padding: 7px 12px; font-size: .82rem; }
.admin-shell .icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #475467; }
.admin-shell .icon-btn:hover { border-color: var(--navy-soft); color: var(--navy-soft); }
.admin-shell .icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
/* Tablas */
.admin-shell .table-wrap { overflow-x: auto; }
.admin-shell .box.table-wrap { padding: 0; }
.admin-shell table { width: 100%; border-collapse: collapse; }
.admin-shell .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; }
.admin-shell .list td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-shell .list tr:last-child td { border-bottom: 0; }
.admin-shell .list small { display: block; color: var(--muted); font-size: .78rem; }
.admin-shell .list .t { font-weight: 700; color: var(--ink); }
.admin-shell .list .t:hover { color: var(--navy-soft); }
.admin-shell .thumb img { width: 74px; height: 54px; object-fit: cover; border-radius: 4px; background: var(--bg); }
.admin-shell .nowrap { white-space: nowrap; }
.admin-shell .actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.admin-shell .actions form { margin: 0; }
.admin-shell .tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.admin-shell .tag.ok { background: #e3f6ec; color: #116237; }
.admin-shell .tag.warn { background: #fdf0d5; color: #8a5a00; }
.admin-shell .switch { position: relative; width: 42px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: #cfd4dc; }
.admin-shell .switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.admin-shell .switch.on { background: #18794e; }
.admin-shell .switch.on i { left: 21px; }
/* Formularios */
.admin-shell .grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px 16px; }
.admin-shell .col-2 { grid-column: span 2; } .admin-shell .col-3 { grid-column: span 3; } .admin-shell .col-4 { grid-column: span 4; } .admin-shell .col-5 { grid-column: span 5; }
.admin-shell .col-6 { grid-column: span 6; } .admin-shell .col-8 { grid-column: span 8; } .admin-shell .col-12 { grid-column: span 12; }
.admin-shell label { display: block; font-size: .82rem; font-weight: 500; color: #344054; }
.admin-shell input[type=text], .admin-shell input[type=number], .admin-shell input[type=email], .admin-shell input[type=url], .admin-shell input[type=password], .admin-shell select, .admin-shell 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);
}
.admin-shell input:focus, .admin-shell select:focus, .admin-shell textarea:focus { outline: 2px solid rgba(20, 48, 107, .22); border-color: var(--navy-soft); }
.admin-shell textarea { resize: vertical; }
.admin-shell .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px 14px; margin-bottom: 16px; }
.admin-shell .check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: .9rem; padding: 4px 0; cursor: pointer; }
.admin-shell .check input { width: 17px; height: 17px; margin: 0; accent-color: var(--navy-soft); }
.admin-shell .variants-edit { min-width: 620px; margin-bottom: 12px; }
.admin-shell .variants-edit th { text-align: left; font-size: .76rem; color: var(--muted); font-weight: 500; padding: 0 6px 2px 0; }
.admin-shell .variants-edit td { padding: 0 6px 8px 0; }
.admin-shell .variants-edit td:first-child { width: 34%; }
.admin-shell .variants-edit input { margin-top: 0; }
.admin-shell .map-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 10px; }
.admin-shell .map { height: 360px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 14px; z-index: 1; }
.admin-shell .photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.admin-shell .photo { border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: .8rem; display: grid; gap: 4px; }
.admin-shell .photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--bg); }
.admin-shell .photo .ord { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.admin-shell .photo .ord input { width: 70px; margin: 0; padding: 4px 8px; }
.admin-shell .photo .del { color: var(--danger); }
.admin-shell .photo span { color: var(--muted); }
.admin-shell .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; }
.admin-shell .drop:hover { border-color: var(--navy-soft); color: var(--navy-soft); }
.admin-shell .drop strong { color: var(--ink); font-size: .95rem; }
.admin-shell .drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.admin-shell .save-bar { position: sticky; bottom: 0; z-index: 20; margin: 0 -32px; box-shadow: 0 -4px 14px rgba(10, 26, 63, .06); display: flex; justify-content: flex-end; gap: 10px; padding: 12px 32px; background: #fff; border-top: 1px solid var(--line); }
.admin-shell .save-bar.inline { position: static; margin: 0; padding: 16px 0 0; border: 0; box-shadow: none; }

.admin-shell .logo-set { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.admin-shell .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; }
.admin-shell .logo-preview img { max-height: 64px; max-width: 260px; width: auto; }
.admin-shell .logo-preview span { display: inline-flex; align-items: center; gap: 10px; }
.admin-shell .logo-fields { flex: 1; min-width: 260px; }
.admin-shell input[type=file] { display: block; width: 100%; margin-top: 6px; padding: 8px; border: 1px dashed #cfd4dc; border-radius: 6px; background: #fff; font: inherit; }

.admin-shell .pw { position: relative; display: block; }
.admin-shell .pw input { padding-right: 44px; }
.admin-shell .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; }
.admin-shell .pw-eye:hover { color: var(--navy-soft); }
.admin-shell .pw-eye .off, .admin-shell .pw-eye.show .on { display: none; }
.admin-shell .pw-eye.show .off { display: inline; }
.admin-shell .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); }
.admin-shell .user-row:last-of-type { border-bottom: 0; }
.admin-shell .user-row .who strong { display: block; }
.admin-shell .user-row .who small { color: var(--muted); }
.admin-shell .user-row .actions { padding-bottom: 2px; }
.admin-shell .login-box .link-row { display: flex; justify-content: space-between; gap: 12px; font-size: .85rem; }
@media (max-width: 860px) { .admin-shell .user-row { grid-template-columns: 1fr; } .admin-shell .user-row .actions { justify-content: flex-start; } }

.admin-shell .agent-row { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start; }
.admin-shell .agent-row > img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--bg); }
.admin-shell .agent-row .save-bar { justify-content: space-between; }
@media (max-width: 860px) { .admin-shell .agent-row { grid-template-columns: 1fr; } }

.admin-shell .sync-box { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.admin-shell .sync-box .hint { margin: 4px 0 0; max-width: 720px; }
.admin-shell .sync-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-shell .sync-err { color: var(--danger); font-weight: 500; }
.admin-shell .tag.eb { background: #e6edfb; color: var(--navy-soft); }
.admin-shell .btn[disabled] { opacity: .6; cursor: wait; }

.admin-shell .excl-form { margin: 0; }
.admin-shell .excl { display: inline-flex; align-items: center; gap: 7px; font-weight: 400; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.admin-shell .excl input { width: 18px; height: 18px; margin: 0; accent-color: #b08d57; cursor: pointer; }
.admin-shell .excl-hint { margin: 0 0 10px; }
.admin-shell .excl-hint a { font-weight: 500; }
.admin-shell .color-set { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 20px; align-items: start; }
.admin-shell .color-set small { display: block; margin-top: 6px; font-weight: 400; color: var(--muted); }
.admin-shell .color-pick { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.admin-shell .color-pick input[type=color] { width: 64px; height: 44px; padding: 2px; border: 1px solid #cfd4dc; border-radius: 6px; background: #fff; cursor: pointer; }
.admin-shell .color-pick code { font-size: .9rem; }
.admin-shell .color-preview { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); color: #fff; font-size: .78rem; }
.admin-shell .color-preview > div { padding: 9px 12px; }
.admin-shell .cp-head { display: flex; gap: 14px; align-items: center; }
.admin-shell .cp-head b { margin-right: auto; }
.admin-shell .cp-hero { padding: 22px 12px !important; font-weight: 700; }
@media (max-width: 860px) { .admin-shell .color-set { grid-template-columns: 1fr; } }

/* Mensajes */
.admin-shell .msg header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.admin-shell .msg header small { color: var(--muted); margin-left: 8px; }
.admin-shell .msg.unread { border-left: 4px solid #18794e; }
.admin-shell .msg-contact { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0; font-size: .88rem; }
.admin-shell .msg-body { color: #344054; }
/* Acceso */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, var(--navy-soft, #14306b), var(--navy-deep, #060f28)); }
.admin-shell .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); }
.admin-shell .login-box h1 { font-size: 1.25rem; text-align: center; }
.admin-shell .login-logo { justify-self: center; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: var(--navy); color: #fff; }
.admin-shell .login-box .btn { width: 100%; padding: 12px; }
.admin-shell .login-box .hint { text-align: center; margin: 0; }
.admin-shell .login-box .alert { margin: 0; }

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

/* Marco del panel entre el encabezado y el pie del sitio */
div.admin-shell { display: flex; align-items: stretch; min-height: 70vh; background: linear-gradient(to right, #0a0a0a 236px, var(--bg) 236px); /* columna del menú en negro hasta el pie */ font-size: 15px; line-height: 1.5; color: var(--ink); }
.admin-shell .side-brand { padding-bottom: 14px; opacity: .85; }
div.admin-shell .side { background: #0a0a0a; }
@media (max-width: 860px) {
  div.admin-shell { display: block; background: var(--bg); }
}
