/* TotalPro design system (web): tokens + componentes compartidos por landing, consola y panel admin.
   Paleta de totalpro.es: azul #0058e0 / #0046b8, marino #0b1a33, superficies slate claras. */
:root {
  --tp-blue: #0058e0; --tp-blue-dark: #0046b8; --tp-navy: #0b1a33; --tp-ring: #d6e4ff;
  --bg: #f4f6fb; --card: #ffffff; --border: #e3e8f0; --text: #0f172a; --muted: #64748b; --soft: #f1f5f9;
}
html { -webkit-font-smoothing: antialiased; }
body { font-family: Inter, 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); }
.surface { background: var(--card); border: 1px solid var(--border); }
.muted { color: var(--muted); }
.shadow-card { box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -12px rgba(11,26,51,.18); }
.shadow-float { box-shadow: 0 2px 6px rgba(15,23,42,.06), 0 16px 40px -16px rgba(11,26,51,.28); }

/* Iconos SVG en linea */
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; display: inline-block; vertical-align: -3px; }
.ico-sm { width: 14px; height: 14px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--soft); color: var(--text); }

/* Navegacion superior */
.nav-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #475569; transition: background .15s, color .15s; white-space: nowrap; }
.nav-btn:hover { background: var(--tp-ring); color: var(--tp-blue-dark); }
.nav-btn.is-active { background: var(--tp-ring); color: var(--tp-blue-dark); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 12px; font-weight: 600; font-size: 13px; transition: background .15s, transform .1s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--tp-blue); color: #fff; box-shadow: 0 6px 16px -8px rgba(0,88,224,.7); }
.btn-primary:hover { background: var(--tp-blue-dark); color: #fff; }
.btn-ghost { background: var(--card); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--soft); }
.btn-navy { background: var(--tp-navy); color: #fff; }
.btn-navy:hover { background: #142847; color: #fff; }
.btn-danger { background: #e11d48; color: #fff; }
.btn-danger:hover { background: #be123c; }

/* Campos y desplegables */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], textarea, select, .field {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--tp-blue); box-shadow: 0 0 0 3px var(--tp-ring); }
select { appearance: none; -webkit-appearance: none; padding-right: 2rem !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230058e0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right .6rem center; }
select:hover { border-color: var(--tp-blue); }
select option:checked { background: var(--tp-ring); color: var(--tp-navy); }
input[type=checkbox] { accent-color: var(--tp-blue); width: 15px; height: 15px; }

/* Tarjetas y tablas */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
table thead th { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
table tbody tr { border-top: 1px solid var(--soft); }
table tbody tr:hover { background: #f8faff; }
a { color: var(--tp-blue); }
::selection { background: var(--tp-ring); }
.scroller::-webkit-scrollbar { width: 8px; height: 8px; }
.scroller::-webkit-scrollbar-thumb { background: rgba(100,116,139,.35); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }

/* Pildoras de estado */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill-green { background: #ecfdf5; color: #047857; } .pill-amber { background: #fffbeb; color: #b45309; }
.pill-red { background: #fff1f2; color: #be123c; } .pill-blue { background: var(--tp-ring); color: var(--tp-blue-dark); }
.pill-slate { background: var(--soft); color: #475569; }
@keyframes tp-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.45); } 70% { box-shadow: 0 0 0 6px rgba(16,185,129,0); } }
.live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: tp-pulse 2s infinite; }

/* Consola en movil: cabecera compacta y botones de navegacion mas pequenos para que no se solapen */
@media (max-width: 640px) {
  #appHeader { gap: 4px 6px; }
  #appHeader .nav-btn { height: 32px; padding: 0 8px; gap: 5px; font-size: 12px; }
  #appHeader img { height: 24px; }
}
