@font-face { font-family: 'Caladea'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/caladea-400.woff2') format('woff2'); }
@font-face { font-family: 'Caladea'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/caladea-700.woff2') format('woff2'); }
:root {
  --berry: #A61E4D; --berry-ink: #7E1239; --berry-soft: #F8E7ED; --cocoa: #3B2A25; --muted: #6B5B55;
  --paper: #F5F1EE; --surface: #fff; --line: #E6D9D0; --leaf: #3F6B4E; --leaf-soft: #E4EFE7;
  --yolk-soft: #FCEFD6; --yolk-ink: #7A4B05; --alert: #B42318; --alert-soft: #FDECEA; --wa: #1F7A4D;
  --serif: 'Caladea', Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font: 17px/1.55 var(--sans); color: var(--cocoa); background: var(--paper); -webkit-text-size-adjust: 100%; }
a { color: var(--berry); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--berry); color: #fff; }
.btn.primary:hover { background: var(--berry-ink); }
.btn.soft { background: var(--berry-soft); color: var(--berry-ink); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--cocoa); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: wait; }
.brandline { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--cocoa); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--berry); position: relative; flex: none; }
.brand-mark::after { content: ''; position: absolute; inset: 9px 7px 9px; border: 2px solid #fff; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom: 0; }

/* Páginas pequeñas: activar y administración */
.mini { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 32px 18px; gap: 22px; }
.box { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px 22px; display: flex; flex-direction: column; gap: 16px; }
.box h1 { font-size: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=password], input[type=tel], input[type=search], input[type=number], select, textarea { width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 17px; border: 1px solid #D7C8BE; border-radius: 10px; background: #fff; color: var(--cocoa); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--berry); box-shadow: 0 0 0 3px rgba(166, 30, 77, .18); }
.code-input { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; font-size: 20px !important; }
.msg { border-radius: 10px; padding: 12px 14px; font-size: 15px; }
.msg.err { background: var(--alert-soft); color: #7A1A12; }
.msg.ok { background: var(--leaf-soft); color: #234531; }
.msg.info { background: var(--yolk-soft); color: #5B3A06; }
.small { font-size: 14px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* Administración */
.admin { width: min(980px, 100%); display: flex; flex-direction: column; gap: 18px; }
.admin .box { width: 100%; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); }
td code { font-size: 15px; font-weight: 700; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12.5px; font-weight: 600; background: var(--leaf-soft); color: var(--leaf); }
.tag.off { background: var(--alert-soft); color: var(--alert); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions button { min-height: 36px; padding: 0 10px; font-size: 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; font-size: 14px; }
.devices { font-size: 13.5px; color: var(--muted); margin: 4px 0 0; padding-left: 18px; }
pre.wa-msg { white-space: pre-wrap; background: var(--paper); border-radius: 10px; padding: 12px; font: 15px/1.5 var(--sans); margin: 0; }
@media (max-width: 700px) {
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 10px; }
  td { border: 0; padding: 4px 0; }
}
