/* vpanel.css (2026-11-15): aspecto del VPanel con la misma linea que el area de cliente de Veilerdesigns (cliente.css).
   Se carga DESPUES de bootstrap y custom.css: redefine la estructura (menu lateral, cabecera, login) y reestiliza
   los componentes de Bootstrap/Gentelella que usan las vistas (x_panel, botones, formularios, tablas...). */

:root {
  --ink: #242426; --txt: #4d4f57; --mut: #8b8d96;
  --or: #f6531c; --or2: #dc4510; --or-soft: #feeae2; --or-ink: #b8380c;
  --dark: #35363b; --dark2: #2b2c30;
  --soft: #ebeff5; --soft2: #dfe4ee; --line: #e2e5f0;
  --ok: #1f9d6b; --ok-soft: #dff5ec; --bad: #c0392b; --bad-soft: #fde8e7;
  --f: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
}

/* ======================================================================
   Base
   ====================================================================== */
html { -webkit-text-size-adjust: 100%; }
body.app, body.auth { margin: 0; font: 400 15px/1.5 var(--f); color: var(--ink); -webkit-font-smoothing: antialiased; font-optical-sizing: auto; }
body.app *, body.auth * { box-sizing: border-box; }
body.app [hidden], body.auth [hidden] { display: none !important; }
body.app a, body.auth a { color: inherit; text-decoration: none; }
body.app h1, body.app h2, body.app h3, body.app h4, body.auth h1 { font-family: var(--f); font-weight: 400; letter-spacing: -.035em; line-height: 1.15; color: var(--ink); }
::selection { background: var(--or); color: #fff; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
.vp-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
mark.vp-mark { background: var(--or); color: #fff; border-radius: 14px; padding: 0 12px 0 8px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
mark.vp-mark em { font-style: italic; }
.vp-or { color: var(--or); }

/* Boton con flecha (.go del area de cliente) */
.go { display: inline-flex; align-items: center; gap: 14px; height: 52px; padding: 4px 22px 4px 4px; border-radius: 14px; border: 0; background: var(--dark); color: #fff !important; font: 400 15px var(--f); letter-spacing: -.01em; transition: background .3s; white-space: nowrap; cursor: pointer; }
.go i { width: 44px; height: 44px; border-radius: 11px; background: var(--or); color: #fff; display: grid; place-items: center; transition: transform .35s var(--ease); }
.go:hover { background: #1f2023; }
.go:hover i { transform: translateX(3px); }
.go--block { width: 100%; }
.go--sm { height: 42px; padding: 3px 16px 3px 3px; gap: 10px; border-radius: 12px; font-size: 14px; }
.go--sm i { width: 36px; height: 36px; border-radius: 9px; }

/* ======================================================================
   Acceso (index.php): mitad izquierda oscura y mitad derecha blanca con el formulario
   ====================================================================== */
body.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: #fff; }
.auth__side { position: relative; overflow: hidden; background: var(--dark); color: #b8bac3; padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; }
.auth__side::before { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(246,83,28,.28), transparent 65%); }
.auth__brand { position: absolute; left: 48px; bottom: -.18em; font-size: clamp(110px, 12vw, 200px); line-height: 1; }
.vd-veiler { display: block; font-weight: 600; letter-spacing: -.07em; line-height: 1; color: #fff; white-space: nowrap; }
.auth__pitch { position: relative; top: -30px; align-self: center; width: min(100%, 440px); text-align: center; }
body.auth .auth__pitch h1 { font-size: clamp(44px, 4.6vw, 64px); line-height: 1.15; color: #fff; margin: 0 0 22px; animation: entra .7s var(--ease) both; }
.auth__pitch p { font-size: 18px; line-height: 1.5; margin: 0; animation: entra .7s .1s var(--ease) both; }
.auth__main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 96px 24px 48px; }
.auth__box { width: min(100%, 420px); display: grid; gap: 18px; }
.auth__box h1 { font-size: 44px; line-height: 1.2; margin: 4px 0 0; }
.auth__foot { text-align: center; font-size: 13px; color: var(--mut); margin: 6px 0 0; }
.auth__error { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fdecea; color: #b3261e; font-size: 14px; }
/* Captcha ALTCHA del acceso (mismo aspecto que en la web) */
body.auth altcha-widget { display: block; --altcha-max-width: 100%; --altcha-border-radius: 12px; --altcha-color-base: var(--soft); --altcha-color-border: transparent; --altcha-color-text: var(--ink); --altcha-color-active: var(--or); --altcha-color-error-text: #b3261e; font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 14px 0 2px; border-radius: 20px; background: var(--soft); font-size: 14px; color: var(--ink); letter-spacing: -.01em; justify-self: start; }
.chip i { width: 24px; height: 24px; border-radius: 50%; background: var(--or); color: #fff; display: grid; place-items: center; }
.chip .vp-ico { width: 14px; height: 14px; stroke-width: 1.9; }
@keyframes entra { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.cform { display: grid; gap: 16px; margin-top: 6px; }
.cform label { display: grid; gap: 7px; font-size: 14px; font-weight: 400; color: #4a4b52; margin: 0; }
.cform input[type=text], .cform input[type=password] { width: 100%; padding: 14px 16px; border: 0; border-radius: 12px; background: var(--soft); font: 400 16px var(--f); color: var(--ink); transition: box-shadow .2s, background .2s; }
.cform input:focus { outline: 0; background: #fff; box-shadow: 0 0 0 2px var(--dark); }
.pass { position: relative; display: block; }
.pass input { padding-right: 92px !important; }
.pass__toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 6px 12px; border: 0; border-radius: 8px; background: #fff; font: 500 13px var(--f); color: var(--ink); cursor: pointer; }

@media (max-width: 900px) {
  body.auth { grid-template-columns: 1fr; }
  .auth__side { padding: 26px 24px; }
  .auth__brand { position: static; font-size: 52px; }
  .auth__pitch { top: 0; margin-top: 18px; text-align: left; align-self: stretch; }
  body.auth .auth__pitch h1 { font-size: 38px; margin-bottom: 0; }
  .auth__pitch p { display: none; }
  .auth__main { padding: 48px 20px 40px; }
  .auth__box h1 { font-size: 34px; }
}

/* ======================================================================
   Panel: barra lateral blanca flotante + contenido sobre gris
   ====================================================================== */
body.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 16px; min-height: 100vh; padding: 16px; background: var(--soft); }
.side { position: sticky; top: 16px; height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 14px; border-radius: 24px; background: #fff; overflow-y: auto; scrollbar-width: thin; }
.side__brand { display: inline-flex; align-items: center; gap: 10px; padding: 0 8px 4px; font-size: 22px; letter-spacing: -.03em; color: var(--ink); white-space: nowrap; }
.side__brand img { height: 26px; width: auto; }
.side__brand b { color: var(--or); font-weight: 700; }
.side__brand small { margin-left: 2px; padding: 2px 8px; border-radius: 8px; background: var(--dark); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.side__nav { display: grid; gap: 3px; }
.side__nav a, .side__nav summary { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 15px; color: var(--txt); cursor: pointer; transition: background .2s, color .2s; list-style: none; }
.side__nav summary::-webkit-details-marker { display: none; }
.side__nav a .vp-ico, .side__nav summary .vp-ico { color: var(--mut); transition: color .2s; }
.side__nav a:hover, .side__nav summary:hover { background: var(--soft); color: var(--ink); }
.side__nav > a.on { background: var(--dark); color: #fff; }
.side__nav > a.on .vp-ico { color: var(--or); }
.side__nav summary .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .25s var(--ease); }
.side__nav details[open] > summary .chev { transform: rotate(180deg); }
.side__nav details.on > summary { color: var(--ink); font-weight: 500; }
.side__nav details.on > summary .vp-ico { color: var(--or); }
.side__sub { display: grid; gap: 2px; margin: 2px 0 6px 22px; padding-left: 12px; border-left: 2px solid var(--line); }
.side__sub a { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.side__sub a.on { background: var(--dark); color: #fff; }
.side__sub a.on::before { content: ""; position: absolute; left: -15px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--or); }
.side__out { margin-top: auto; }
.side__out a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; font-size: 15px; color: var(--txt); transition: background .2s, color .2s; }
.side__out a:hover { background: var(--or-soft); color: var(--or-ink); }
.side__veil { position: fixed; inset: 0; z-index: 29; background: rgba(36,36,38,.35); backdrop-filter: blur(2px); }

.app__main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; padding: 6px 8px 18px; }
.top__menu { display: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: #fff; position: relative; cursor: pointer; }
.top__menu span { position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--ink); }
.top__menu span:first-child { top: 17px; } .top__menu span:last-child { top: 25px; }
.top__hi { display: grid; line-height: 1.25; min-width: 0; }
.top__hi small { color: var(--mut); font-size: 13px; }
.top__hi b { font-weight: 500; font-size: 18px; letter-spacing: -.02em; text-transform: capitalize; }
.top__date { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 20px; background: #fff; font-size: 14px; color: var(--txt); white-space: nowrap; }
.top__date i { width: 8px; height: 8px; border-radius: 50%; background: var(--or); box-shadow: 0 0 0 4px var(--or-soft); }
.avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--dark); color: #fff; font-weight: 600; font-size: 14px; text-transform: uppercase; }

.views { width: 100%; max-width: none; padding: 0 8px 40px; }
.views > .row:first-child, .views > .page-title:first-child { margin-top: 0; }
body.app footer.vp-foot { margin: 0; padding: 8px 8px 0; background: none; border: 0; font-size: 13px; color: var(--mut); }

@media (max-width: 980px) {
  body.app { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .side { position: fixed; left: 12px; top: 12px; bottom: 12px; height: auto; width: min(290px, calc(100vw - 24px)); z-index: 30; transform: translateX(calc(-100% - 24px)); transition: transform .35s var(--ease); box-shadow: 0 30px 60px -20px rgba(0,0,0,.35); }
  .side.open { transform: none; }
  body.bloq { overflow: hidden; }
  .top__menu { display: block; }
  .top { padding: 0 0 8px; }
  .top__date { display: none; }
  .views { padding: 0 0 32px; }
}

/* ======================================================================
   Panel de inicio: indicadores y tarjetas de graficos
   ====================================================================== */
.vhead { display: grid; gap: 12px; justify-items: start; padding: 14px 0 22px; }
.vhead h1 { font-size: clamp(32px, 3.6vw, 46px); margin: 0; }
.vhead p { margin: 0; color: var(--mut); font-size: 16px; }
.kpis { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.kpi { position: relative; overflow: hidden; display: grid; gap: 6px; align-content: start; padding: 24px 26px; border-radius: 22px; background: #fff; animation: entra .5s var(--ease) both; transition: transform .3s var(--ease), box-shadow .3s; }
.kpi:nth-child(2) { animation-delay: .06s; } .kpi:nth-child(3) { animation-delay: .12s; }
a.kpi:hover { transform: translateY(-3px); box-shadow: 0 24px 40px -28px rgba(53,54,59,.45); }
.kpi small { font-size: 12.5px; color: var(--mut); text-transform: uppercase; letter-spacing: .07em; }
.kpi__ico { position: absolute; right: 22px; top: 22px; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--ink); }
.kpi__num { font-size: clamp(34px, 3.4vw, 46px); letter-spacing: -.055em; line-height: 1.05; font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi__num sup { font-size: .5em; top: -.75em; margin-left: 3px; letter-spacing: 0; }
.kpi__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--mut); }
.kpi--dark { background: var(--dark); color: #b8bac3; }
.kpi--dark::after { content: ""; position: absolute; width: 300px; height: 300px; right: -110px; bottom: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(246,83,28,.35), transparent 65%); pointer-events: none; }
.kpi--dark small { color: #9a9ca5; }
.kpi--dark .kpi__num { color: #fff; }
.kpi--dark .kpi__ico { background: rgba(255,255,255,.08); color: var(--or); }
.kpi--dark .kpi__sub { color: #9a9ca5; }
.delta { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta .vp-ico { width: 14px; height: 14px; stroke-width: 2.4; }
.delta--up { background: var(--ok-soft); color: var(--ok); }
.delta--down { background: var(--bad-soft); color: var(--bad); }
.kpi--dark .delta--up { background: rgba(31,157,107,.18); color: #4fd6a1; }
.kpi--dark .delta--down { background: rgba(246,83,28,.18); color: #ff8a5f; }

.dash { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.dash > .ccard { grid-column: span 3; }
.dash > .ccard--third { grid-column: span 2; }
.ccard { display: grid; gap: 4px; align-content: start; padding: 24px 26px 20px; border-radius: 22px; background: #fff; min-width: 0; animation: entra .55s var(--ease) both; }
.ccard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ccard__head small { display: block; font-size: 12.5px; color: var(--mut); text-transform: uppercase; letter-spacing: .07em; }
.ccard__head h2 { margin: 2px 0 0; font-size: 21px; }
.ccard__tag { flex: none; padding: 5px 11px; border-radius: 20px; background: var(--soft); font-size: 12.5px; color: var(--txt); white-space: nowrap; }
.chart-sum { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 10px 0 6px; }
.chart-sum b { font-size: 32px; font-weight: 400; letter-spacing: -.05em; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-sum span { font-size: 14px; color: var(--mut); }
.vp-chart { position: relative; height: 290px; margin-top: 6px; }
.vp-chart--sm { height: 230px; }
.vp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--txt); }
.vp-legend li { display: inline-flex; align-items: center; gap: 7px; }
.vp-legend i { width: 10px; height: 10px; border-radius: 3px; }
.vp-legend i.dash { height: 2px; border-radius: 0; background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; }

/* Planes web: rosco + lista */
.plans { display: grid; gap: 16px; margin-top: 10px; }
.plans .vp-chart { height: 170px; margin: 0; }
.plans ul { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 0; padding: 0; list-style: none; }
.plans li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; font-size: 14px; color: var(--txt); }
.plans li i { width: 10px; height: 10px; border-radius: 3px; }
.plans li b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.plans li em { font-style: normal; color: var(--mut); font-size: 12.5px; margin-left: 6px; }
.plans li.zero { opacity: .45; }

@media (max-width: 1200px) {
  .dash > .ccard, .dash > .ccard--third { grid-column: span 3; }
  .dash > .ccard--third:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .kpis { grid-template-columns: 1fr; }
  .dash { grid-template-columns: 1fr; }
  .dash > .ccard, .dash > .ccard--third, .dash > .ccard--third:last-child { grid-column: auto; }
  .ccard { padding: 20px 18px 16px; }
  .vp-chart { height: 250px; }
}
@media (max-width: 420px) {
  .plans ul { grid-template-columns: 1fr; }
}

/* ======================================================================
   Componentes de Bootstrap / Gentelella que usan las vistas
   ====================================================================== */
body.app .page-title { display: block; padding: 14px 0 10px; height: auto; margin: 0; }
body.app .page-title .title_left { width: 100% !important; float: none; }
body.app .page-title h3 { font-size: clamp(28px, 3vw, 40px); margin: 0 0 6px; letter-spacing: -.04em; }
body.app .page-title h3 br { display: none; }

body.app .x_panel { position: relative; width: 100%; margin-bottom: 16px; padding: 22px 24px; border: 0; border-radius: 20px; background: #fff; box-shadow: none; animation: entra .45s var(--ease) both; }
body.app .x_title { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 0 0 14px; border-bottom: 1px solid var(--line); }
body.app .x_title h2 { flex: 1; margin: 0; float: none; font-size: 19px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); white-space: normal; overflow: visible; text-overflow: clip; }
body.app .x_title h2 small { color: var(--mut); }
body.app .x_title h2 .fa { width: 32px; height: 32px; margin-right: 10px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--or-soft); color: var(--or); font-size: 14px; vertical-align: middle; }
body.app .x_title .clearfix { display: none; }
body.app .panel_toolbox { float: none; min-width: 0; margin: 0; }
body.app .panel_toolbox > li > a { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 9px; background: var(--soft); color: var(--txt); font-size: 12px; transition: background .2s, color .2s; }
body.app .panel_toolbox > li > a:hover { background: var(--dark); color: #fff; }
body.app .x_content { padding: 0; margin-top: 0; float: none; clear: both; color: var(--txt); }

/* Botones */
body.app .btn { border: 0; border-radius: 10px; padding: 9px 16px; font: 500 14px var(--f); letter-spacing: -.005em; box-shadow: none !important; text-shadow: none; transition: background .2s, color .2s, transform .2s var(--ease); }
body.app .btn:active { transform: translateY(1px); }
body.app .btn-xs { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
body.app .btn-sm { padding: 7px 12px; font-size: 13px; }
body.app .btn-lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
body.app .btn-default { background: var(--soft); color: var(--txt); }
body.app .btn-default:hover, body.app .btn-default:focus { background: var(--soft2); color: var(--ink); }
body.app .btn-primary, body.app .btn-success { background: var(--dark); color: #fff; }
body.app .btn-primary:hover, body.app .btn-success:hover, body.app .btn-primary:focus, body.app .btn-success:focus { background: #1f2023; color: #fff; }
body.app .btn-info { background: var(--or-soft); color: var(--or-ink); }
body.app .btn-info:hover, body.app .btn-info:focus { background: var(--or); color: #fff; }
body.app .btn-warning { background: var(--or); color: #fff; }
body.app .btn-warning:hover { background: var(--or2); color: #fff; }
body.app .btn-danger { background: var(--bad-soft); color: var(--bad); }
body.app .btn-danger:hover, body.app .btn-danger:focus { background: var(--bad); color: #fff; }
body.app .btn .fa { margin-right: 2px; }
body.app .btn-default.active, body.app .btn-default:active, body.app .open > .dropdown-toggle.btn-default { background: var(--dark); color: #fff; }
body.app .btn-group > .btn { margin: 0 4px 4px 0; border-radius: 10px !important; }
body.app .btn-app { min-width: 96px; height: auto; margin: 0 8px 8px 0; padding: 14px 12px 12px; border: 0; border-radius: 14px; background: var(--soft); color: var(--txt); font-size: 13px; }
body.app .btn-app .fa { display: block; margin: 0 auto 6px; font-size: 20px; color: var(--or); }
body.app .btn-app:hover { background: var(--dark); color: #fff; }

/* Formularios */
body.app .form-control { height: 44px; padding: 10px 14px; border: 0; border-radius: 12px; background: var(--soft); box-shadow: none; font: 400 15px var(--f); color: var(--ink); transition: box-shadow .2s, background .2s; }
body.app textarea.form-control { height: auto; min-height: 110px; }
body.app select.form-control { padding-right: 32px; }
body.app .form-control:focus { background: #fff; box-shadow: 0 0 0 2px var(--dark); outline: 0; }
body.app .form-control[readonly], body.app .form-control[disabled] { background: #f4f6fa; color: var(--mut); }
body.app .control-label, body.app label { font-weight: 400; color: #4a4b52; font-size: 14px; }
body.app .form-group { margin-bottom: 14px; }
body.app .form-horizontal .control-label { padding-top: 12px; }
body.app .required { color: var(--or); }
body.app .ln_solid { border-top: 1px solid var(--line); margin: 18px 0; }
body.app .input-group-addon { border: 0; border-radius: 12px; background: var(--soft2); color: var(--txt); }

/* Tablas */
body.app .table { margin-bottom: 0; font-size: 14px; color: var(--ink); }
body.app .table > thead > tr > th { padding: 13px 14px; border: 0; background: #f6f8fb; font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--mut); white-space: nowrap; }
body.app .table > thead > tr > th:first-child { border-radius: 10px 0 0 10px; }
body.app .table > thead > tr > th:last-child { border-radius: 0 10px 10px 0; }
body.app .table > tbody > tr > td, body.app .table > tbody > tr > th { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
body.app .table > tbody > tr:first-child > td, body.app .table > tbody > tr:first-child > th { border-top: 0; }
body.app .table-striped > tbody > tr:nth-of-type(odd) { background: transparent; }
body.app .table-hover > tbody > tr:hover, body.app .table-striped > tbody > tr:hover { background: #fafbfd; }
body.app .table > tbody > tr > th[scope=row] { color: var(--mut); font-weight: 500; }

/* Etiquetas, avisos, progreso, desplegables */
body.app .label { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 500; letter-spacing: .01em; }
body.app .label-default { background: var(--soft); color: var(--txt); }
body.app .label-success { background: var(--ok-soft); color: var(--ok); }
body.app .label-danger { background: var(--bad-soft); color: var(--bad); }
body.app .label-warning, body.app .label-info, body.app .label-primary { background: var(--or-soft); color: var(--or-ink); }
body.app .alert { border: 0; border-radius: 12px; font-weight: 500; }
body.app .alert-success { background: var(--ok-soft); color: var(--ok); }
body.app .alert-danger { background: var(--bad-soft); color: var(--bad); }
body.app .alert-info, body.app .alert-warning { background: var(--or-soft); color: var(--or-ink); }
body.app .progress { height: 10px; border-radius: 10px; background: var(--soft); box-shadow: none; overflow: hidden; }
body.app .progress-bar, body.app .progress-bar.bg-green, body.app .progress-bar-info { background: var(--or); box-shadow: none; }
body.app .dropdown-menu { border: 0; border-radius: 14px; padding: 6px; box-shadow: 0 20px 40px -20px rgba(36,36,38,.35); }
body.app .dropdown-menu > li > a { padding: 9px 12px; border-radius: 9px; color: var(--txt); }
body.app .dropdown-menu > li > a:hover { background: var(--soft); color: var(--ink); }
body.app .green { color: var(--ok); }
body.app .red { color: var(--bad); }
body.app .modal-content { border: 0; border-radius: 20px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); }
body.app .dataTables_wrapper .dataTables_filter input, body.app .dataTables_wrapper .dataTables_length select { border: 0; border-radius: 10px; background: var(--soft); padding: 8px 12px; }
body.app .pagination > li > a, body.app .pagination > li > span { border: 0; margin: 0 2px; border-radius: 8px !important; color: var(--txt); }
body.app .pagination > .active > a, body.app .pagination > .active > span { background: var(--dark); color: #fff; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ======================================================================
   Mapa de clientes (view_customers_map.php)
   ====================================================================== */
.vmap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.vmap__map { position: relative; min-width: 0; padding: 8px; border-radius: 22px; background: #fff; animation: entra .55s var(--ease) both; }
#map_canvas { height: min(72vh, 680px); min-height: 380px; border-radius: 16px; overflow: hidden; z-index: 0; background: var(--soft); }
#map_canvas .leaflet-tile-pane { filter: saturate(.55) contrast(1.02); }
.vmap__hint { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); z-index: 500; max-width: calc(100% - 40px); padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.45); }
.vmap__list { display: grid; gap: 10px; padding: 20px; border-radius: 22px; background: #fff; max-height: calc(min(72vh, 680px) + 16px); overflow: auto; animation: entra .55s var(--ease) .05s both; }
.vmap__list h2 { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.vmap__list h2:first-child { margin-top: 0; }
.vmap__list h2 span { padding: 1px 9px; border-radius: 999px; background: var(--soft); color: var(--txt); font-size: 12.5px; font-weight: 500; letter-spacing: 0; }
.vmap__help { margin: -4px 0 0; color: var(--mut); font-size: 13px; }
.vmap__list ul { display: grid; gap: 2px; margin: 0 0 6px; padding: 0; list-style: none; }
.vmap__list li { display: flex; align-items: center; gap: 10px; border-radius: 12px; }
.vmap__list li[hidden] { display: none; }
.vmap__list li > span, .vmap__list .js-go { display: grid; flex: 1; min-width: 0; padding: 8px 10px; text-align: left; border: 0; border-radius: 12px; background: none; font: inherit; color: var(--ink); cursor: default; }
.vmap__list .js-go { cursor: pointer; transition: background .2s; }
.vmap__list .js-go:hover { background: var(--soft); }
.vmap__list b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vmap__list small { color: var(--mut); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#notFound li { background: var(--or-soft); }
#notFound li.on { box-shadow: inset 0 0 0 2px var(--or); }
#notFound .js-fix { margin-right: 8px; }
#notFound li.on .js-fix { background: var(--or); color: #fff; }
.vpin { background: none; border: 0; }
.vpin span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--or); border: 3px solid #fff; box-shadow: 0 6px 14px -4px rgba(36,36,38,.55); color: #fff; font: 600 12px/1 var(--f); }
.vpin b { transform: rotate(45deg); font-weight: 600; }
.vpin b:empty { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.vpin--many span { background: var(--dark); }
.vpin--approx span { background: #f9a27f; }
.vpin--manual span { background: #7a5cf0; }
.vmap__legend { position: absolute; left: 20px; bottom: 20px; z-index: 500; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.92); font-size: 12.5px; color: var(--txt); box-shadow: 0 8px 20px -10px rgba(0,0,0,.3); }
.vmap__legend span { display: inline-flex; align-items: center; gap: 6px; }
.vpin-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--or); }
.vpin-dot--approx { background: #f9a27f; }
.vpin-dot--manual { background: #7a5cf0; }
.vmap__progress { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--soft); font-size: 13px; }
.vmap__progress b { font-weight: 500; }
.vmap__progress span { height: 6px; border-radius: 99px; background: #fff; overflow: hidden; }
.vmap__progress i { display: block; height: 100%; width: 0; background: var(--or); transition: width .4s var(--ease); }
.tag-approx { font-style: normal; font-weight: 500; font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--or-soft); color: var(--or2); }
.vmap__list small { white-space: normal; }
.vpop__item { display: grid; gap: 2px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.vpop__item:last-child { border-bottom: 0; }
.vpop__item a { padding: 0; }
.vpop__item em { font-style: normal; font-size: 12px; color: var(--ok); }
.vpop__item em.approx { color: var(--or2); }
.vpop__item .btn { justify-self: start; margin-top: 4px; }
.leaflet-container { font-family: var(--f); }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 18px 40px -14px rgba(36,36,38,.45); }
.leaflet-popup-content { margin: 10px 12px; }
.vpop { display: grid; gap: 2px; max-height: 220px; overflow: auto; }
.vpop a { display: grid; padding: 6px 8px; border-radius: 9px; color: var(--ink) !important; transition: background .2s; }
.vpop a:hover { background: var(--soft); }
.vpop b { font-weight: 500; font-size: 14px; }
.vpop small { color: var(--mut); font-size: 12px; }
@media (max-width: 1100px) {
  .vmap { grid-template-columns: minmax(0, 1fr); }
  .vmap__list { max-height: none; }
  #map_canvas { height: 60vh; }
}

/* ======================================================================
   Panel de control (view_control_panel.php) - estilo sobrio y denso
   ====================================================================== */
.dh { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 6px 0 20px; }
.dh__eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--or2); }
body.app .dh h1 { margin: 0; font-size: clamp(26px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.03em; }
.dh__sub { margin: 6px 0 0; color: var(--mut); font-size: 14px; }
.dh__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dh__actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.dh__actions .vp-ico { width: 16px; height: 16px; }

.db-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.db-kpi { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); overflow: hidden; animation: entra .45s var(--ease) both; }
.db-kpi--link { transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.db-kpi--link:hover { border-color: #cfd5e2; box-shadow: 0 10px 24px -16px rgba(36,36,38,.35); transform: translateY(-1px); }
.db-kpi__label { margin: 0; font-size: 13px; font-weight: 500; color: var(--mut); }
.db-kpi__value { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.db-kpi__value small { margin-left: 4px; font-size: 15px; font-weight: 500; color: var(--mut); letter-spacing: 0; }
.db-kpi__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; font-size: 13px; color: var(--txt); }
.db-kpi__foot { display: flex; align-items: center; gap: 6px; margin: auto 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--mut); }
.db-kpi__spark { height: 44px; margin: auto -20px -18px; }
.db-delta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.db-delta--up { background: #e3f4ec; color: #157a52; }
.db-delta--down { background: #fde8e4; color: #b4321a; }
.db-status { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #fff1d6; color: #9a5b00; font-size: 11px; font-weight: 700; }

.db-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.db-span-8 { grid-column: span 8; }
.db-span-6 { grid-column: span 6; }
.db-span-4 { grid-column: span 4; }
.db-span-3 { grid-column: span 3; }
.db-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; animation: entra .5s var(--ease) both; }
.db-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
body.app .db-card__head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.db-card__head p { margin: 2px 0 0; font-size: 13px; color: var(--mut); }
.db-link { flex: none; font-size: 13px; font-weight: 500; color: var(--or2) !important; }
.db-link:hover { text-decoration: underline !important; }
.db-legend { display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--txt); }
.db-legend li { display: inline-flex; align-items: center; gap: 6px; }
.db-sw { width: 10px; height: 10px; border-radius: 3px; }
.db-sw--dash { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed #80838c; }
.db-chart { position: relative; height: 280px; }
.db-chart--sm { height: 220px; }
.db-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.db-stats dt { font-size: 12px; font-weight: 500; color: var(--mut); }
.db-stats dd { margin: 2px 0 0; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.db-stats dd span { margin-left: 4px; font-size: 12.5px; font-weight: 400; color: var(--mut); }
.db-data summary { width: max-content; cursor: pointer; font-size: 12.5px; color: var(--mut); list-style: none; }
.db-data summary::-webkit-details-marker { display: none; }
.db-data summary::before { content: "\25B8  "; }
.db-data[open] summary::before { content: "\25BE  "; }
.db-data .db-table-wrap { margin-top: 10px; }
.db-table-wrap { overflow-x: auto; }
.db-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.db-table th, .db-table td { padding: 7px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.db-table th:first-child, .db-table td:first-child { text-align: left; }
.db-table thead th { font-size: 12px; font-weight: 500; color: var(--mut); }
.db-table--rows td, .db-table--rows th { text-align: left; }
.db-table--rows td.num, .db-table--rows th.num { text-align: right; }
.db-table--rows tbody tr:last-child td { border-bottom: 0; }
.db-table--rows td small { display: block; font-size: 12px; color: var(--mut); }
.db-table--rows a { color: var(--ink); font-weight: 500; }
.db-table--rows a:hover { color: var(--or2); }
.db-pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.db-pill--ok { background: #e3f4ec; color: #157a52; }
.db-pill--warn { background: #fff1d6; color: #8a5200; }
.nowrap { white-space: nowrap; }

.db-bars { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.db-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track"; gap: 6px 12px; align-items: end; }
.db-bars__label { grid-area: label; display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 13.5px; color: var(--ink); }
.db-bars__label small { font-size: 12px; color: var(--mut); white-space: nowrap; }
.db-bars li > b { grid-area: value; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.db-bars__track { grid-area: track; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.db-bars__track i { display: block; height: 100%; min-width: 2px; border-radius: 4px; background: var(--or); }
.db-bars li.is-old .db-bars__track i { background: #c2410c; }
.db-bars li.is-muted .db-bars__track i { background: #80838c; }
.db-bars li.is-zero .db-bars__track i { min-width: 0; }
.db-bars li.is-muted .db-bars__label, .db-bars li.is-zero .db-bars__label, .db-bars li.is-zero > b { color: var(--mut); }
.db-subhead { margin: 4px 0 -4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
.db-list { display: grid; margin: 0; padding: 0; list-style: none; }
.db-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.db-list li:last-child { border-bottom: 0; }
.db-list li span { display: grid; min-width: 0; }
.db-list li span b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-list small { font-size: 12px; color: var(--mut); }
.db-list li > b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-big { display: grid; margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.db-big small { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--mut); }
.db-note { margin: auto 0 0; font-size: 12px; color: var(--mut); }

@media (max-width: 1280px) {
  .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-span-8, .db-span-6, .db-span-4 { grid-column: span 12; }
  .db-span-3 { grid-column: span 6; }
}
@media (max-width: 700px) {
  .db-kpis { grid-template-columns: minmax(0, 1fr); }
  .db-span-3 { grid-column: span 12; }
  .db-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .db-chart { height: 240px; }
}

/* ======================================================================
   Botones de accion dentro de las tablas (listados de clientes, facturas...):
   neutros y discretos; el color solo aparece al pasar el raton.
   ====================================================================== */
body.app table .btn-xs { display: inline-flex; align-items: center; gap: 5px; margin: 1px 1px 1px 0; padding: 3px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--txt); font-size: 12px; font-weight: 500; line-height: 1.4; transition: background .15s, border-color .15s, color .15s; }
body.app table .btn-xs .fa { font-size: 11px; color: var(--mut); transition: color .15s; }
body.app table .btn-xs:hover, body.app table .btn-xs:focus { background: var(--soft); border-color: #cfd5e2; color: var(--ink); }
body.app table .btn-xs:hover .fa, body.app table .btn-xs:focus .fa { color: var(--ink); }
/* ACCION PRINCIPAL (Activar, Act. en silencio): TEXTO OSCURO, SIN RELLENO */
body.app table .btn-success.btn-xs, body.app table .btn-primary.btn-xs { color: var(--ink); border-color: #cfd5e2; }
body.app table .btn-success.btn-xs .fa, body.app table .btn-primary.btn-xs .fa { color: #157a52; }
/* ACCIONES DELICADAS (A bajas, A proceso, Eliminar): ROJO SOLO AL PASAR EL RATON */
body.app table .btn-danger.btn-xs:hover, body.app table .btn-danger.btn-xs:focus { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
body.app table .btn-danger.btn-xs:hover .fa, body.app table .btn-danger.btn-xs:focus .fa { color: var(--bad); }
body.app table .btn-xs:focus-visible { outline: 2px solid var(--or); outline-offset: 1px; }
body.app table:has(.btn-xs) td, body.app table:has(.btn-xs) th { white-space: nowrap; }
body.app .x_content:has(> table .btn-xs), body.app .x_content:has(> .table-responsive) { overflow-x: auto; }
body.app table:has(.btn-xs) > tbody > tr > td, body.app table:has(.btn-xs) > thead > tr > th { padding-left: 8px; padding-right: 8px; }

/* ======================================================================
   Acciones de fila como GRUPO DE BOTONES (estilo panel de gestion):
   un solo bloque con separadores; la accion destructiva va aparte.
   ====================================================================== */
body.app td:has(> .btn-xs) { font-size: 0; }	/* SIN HUECOS ENTRE BOTONES (espacios del HTML) */
body.app td > .btn-xs { position: relative; height: 28px; margin: 0 0 0 -1px; padding: 0 10px; border-radius: 0; box-shadow: 0 1px 2px rgba(16,24,40,.06); font-size: 12px; color: #3f4149; }
body.app td > .btn-xs:first-of-type { margin-left: 0; border-radius: 8px 0 0 8px; }
body.app td > .btn-xs:last-of-type { border-radius: 0 8px 8px 0; }
body.app td > .btn-xs:only-of-type { border-radius: 8px; }
body.app td > .btn-xs:hover, body.app td > .btn-xs:focus { z-index: 1; background: #f7f8fb; border-color: #c9cfdb; }
/* EL BOTON ANTERIOR A UNA ACCION DESTRUCTIVA CIERRA EL GRUPO */
body.app td > .btn-xs:has(+ .btn-danger) { border-radius: 0 8px 8px 0; }
body.app td > .btn-xs:first-of-type:has(+ .btn-danger) { border-radius: 8px; }
/* ACCION DESTRUCTIVA: SEPARADA DEL GRUPO */
body.app td > .btn-danger.btn-xs { margin-left: 8px; border-radius: 8px; color: #8a3a2e; }
body.app td > .btn-danger.btn-xs .fa { color: #c0533f; }
body.app td > .btn-danger.btn-xs + .btn-danger.btn-xs { margin-left: 6px; }
body.app td > .btn-danger.btn-xs:first-of-type { margin-left: 0; }

/* ======================================================================
   ESTILO DE "INICIO" EN EL RESTO DEL PANEL (vistas con el marcado antiguo
   page-title / x_panel / x_title / table / form). Va al final para mandar.
   ====================================================================== */
/* TITULO DE LA PAGINA, COMO .dh */
body.app .page-title { padding: 6px 0 20px; }
body.app .page-title h3 { margin: 0; font-size: clamp(26px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; color: var(--ink); }
body.app .page-title h3::before { content: "VPanel"; display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--or2); }
body.app .page-title h3 small { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--mut); }

/* TARJETAS, COMO .db-card */
body.app .x_panel { padding: 20px; border: 1px solid var(--line); border-radius: 16px; }
body.app .x_title { gap: 10px; margin: 0 0 16px; padding: 0 0 14px; }
body.app .x_title h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
body.app .x_title h2 small { margin-left: 6px; font-size: 13px; font-weight: 400; }
body.app .x_title h2 .fa { width: 26px; height: 26px; margin-right: 8px; border-radius: 7px; background: var(--soft); color: var(--txt); font-size: 12px; }
body.app .panel_toolbox > li > a { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--mut); }
body.app .panel_toolbox > li > a:hover { border-color: #c9cfdb; background: var(--soft); color: var(--ink); }

/* TABLAS, COMO .db-table */
body.app .table { font-size: 13.5px; font-variant-numeric: tabular-nums; }
body.app .table > thead > tr > th { padding: 9px 12px; border-bottom: 1px solid var(--line); background: transparent; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--mut); }
body.app .table > thead > tr > th:first-child, body.app .table > thead > tr > th:last-child { border-radius: 0; }
body.app .table > tbody > tr > td, body.app .table > tbody > tr > th { padding: 10px 12px; border-top: 0; border-bottom: 1px solid var(--line); }
body.app .table > tbody > tr:last-child > td, body.app .table > tbody > tr:last-child > th { border-bottom: 0; }
body.app .table-hover > tbody > tr:hover, body.app .table-striped > tbody > tr:hover, body.app .table > tbody > tr:hover { background: #f9fafc; }

/* FORMULARIOS: CAMPOS BLANCOS CON BORDE FINO */
body.app .form-control { height: 40px; padding: 8px 12px; border: 1px solid #d9dee8; border-radius: 10px; background: #fff; font-size: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: border-color .15s, box-shadow .15s; }
body.app textarea.form-control { height: auto; min-height: 96px; }
body.app .form-control:hover { border-color: #c9cfdb; }
body.app .form-control:focus { border-color: var(--or); background: #fff; box-shadow: 0 0 0 3px rgba(246,83,28,.15); }
body.app .form-control[readonly], body.app .form-control[disabled] { border-color: var(--line); background: #f6f7fa; box-shadow: none; }
body.app .control-label, body.app label { font-size: 13px; font-weight: 500; color: var(--txt); }
body.app .form-horizontal .control-label { padding-top: 10px; }
body.app .form-group { margin-bottom: 14px; }
body.app .ln_solid { margin: 18px 0; border-top: 1px solid var(--line); background: none; height: 0; }

/* BOTONES GENERALES (FUERA DE LAS TABLAS) */
body.app .btn:not(.btn-xs) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 500; }
body.app .btn-sm:not(.btn-xs) { height: 32px; padding: 0 12px; font-size: 13px; }
body.app .btn-lg:not(.btn-xs) { height: 46px; padding: 0 22px; font-size: 15px; }
body.app .btn-default:not(.btn-xs) { border-color: #d9dee8; background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.05) !important; }
body.app .btn-default:not(.btn-xs):hover, body.app .btn-default:not(.btn-xs):focus { border-color: #c9cfdb; background: #f7f8fb; color: var(--ink); }
body.app .btn-primary:not(.btn-xs), body.app .btn-success:not(.btn-xs) { background: var(--dark); color: #fff; }
body.app .btn-info:not(.btn-xs) { border-color: #d9dee8; background: #fff; color: var(--ink); }
body.app .btn-info:not(.btn-xs):hover, body.app .btn-info:not(.btn-xs):focus { background: #f7f8fb; color: var(--ink); }
body.app .btn-warning:not(.btn-xs) { background: var(--or); color: #fff; }
body.app .btn-danger:not(.btn-xs) { border-color: #f1c9c1; background: #fff; color: #b4321a; }
body.app .btn-danger:not(.btn-xs):hover, body.app .btn-danger:not(.btn-xs):focus { background: var(--bad-soft); color: var(--bad); }
body.app .btn:not(.btn-xs) .fa { font-size: 13px; }

/* ETIQUETAS Y AVISOS, COMO .db-pill */
body.app .label { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
body.app .label-success { background: #e3f4ec; color: #157a52; }
body.app .label-warning, body.app .label-info, body.app .label-primary { background: #fff1d6; color: #8a5200; }
body.app .label-danger { background: #fde8e4; color: #b4321a; }
body.app .alert { padding: 12px 16px; border: 1px solid transparent; border-radius: 12px; font-size: 14px; font-weight: 500; }
body.app .alert-success { border-color: #c6e8d7; background: #effaf4; color: #157a52; }
body.app .alert-danger { border-color: #f6cfc6; background: #fdf1ee; color: #b4321a; }
body.app .alert-info, body.app .alert-warning { border-color: #f5ddb0; background: #fff8e9; color: #8a5200; }

/* CABECERA DE PAGINA .vhead (MAPA) CON EL MISMO TONO QUE INICIO */
body.app .vhead h1 { font-size: clamp(26px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.03em; }
body.app .vhead .vp-mark { padding: 0; background: none; color: inherit; }
body.app .vhead .vp-mark em { font-style: normal; }
body.app .vmap__map, body.app .vmap__list { border: 1px solid var(--line); border-radius: 16px; }

/* ======================================================================
   TEMA "GRAFITO + NARANJA": barra lateral oscura, cabeceras de pagina en banda
   oscura con brillo de marca, acentos de color en indicadores y botones principales.
   ====================================================================== */
:root { --gr1: #17181c; --gr2: #24252b; --gr3: #2f3037; --grad: linear-gradient(135deg, #ff7a3d 0%, #f6531c 45%, #e23d0b 100%); }
body.app { background: #eceff5; }

/* --- BARRA LATERAL OSCURA --- */
body.app .side { background: var(--gr1); box-shadow: 0 24px 50px -30px rgba(10,10,14,.6); }
body.app .side__brand { color: #fff; }
body.app .side__brand small { background: var(--grad); color: #fff; }
body.app .side__nav a, body.app .side__nav summary, body.app .side__out a { color: #b9bcc6; }
body.app .side__nav a .vp-ico, body.app .side__nav summary .vp-ico, body.app .side__out a .vp-ico { color: #7d808b; }
body.app .side__nav a:hover, body.app .side__nav summary:hover { background: rgba(255,255,255,.06); color: #fff; }
body.app .side__nav a:hover .vp-ico, body.app .side__nav summary:hover .vp-ico { color: #fff; }
body.app .side__nav > a.on, body.app .side__sub a.on { background: var(--grad); color: #fff; box-shadow: 0 10px 22px -12px rgba(246,83,28,.9); }
body.app .side__nav > a.on .vp-ico { color: #fff; }
body.app .side__nav details.on > summary { color: #fff; }
body.app .side__nav details.on > summary .vp-ico { color: #ff8a57; }
body.app .side__sub { border-left-color: rgba(255,255,255,.08); }
body.app .side__sub a.on::before { display: none; }
body.app .side__out { padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); }
body.app .side__out a:hover { background: rgba(246,83,28,.14); color: #ffb08f; }
body.app .side::-webkit-scrollbar-thumb { background: #3a3b42; }

/* --- CABECERA SUPERIOR --- */
body.app .top__date { border: 1px solid var(--line); }
body.app .avatar { background: var(--grad); box-shadow: 0 8px 18px -10px rgba(246,83,28,.9); }

/* --- BANDA OSCURA DE CABECERA (INICIO Y RESTO DE PAGINAS) --- */
body.app .dh, body.app .page-title, body.app .vhead {
	position: relative; overflow: hidden; margin-bottom: 18px; padding: 28px 30px; border-radius: 20px; color: #fff;
	background:
		radial-gradient(520px 260px at 92% -30%, rgba(246,83,28,.55), transparent 70%),
		radial-gradient(380px 220px at 70% 140%, rgba(61,111,182,.35), transparent 70%),
		linear-gradient(135deg, var(--gr2), var(--gr1));
}
body.app .dh::after, body.app .page-title::after, body.app .vhead::after {
	content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
	background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 18px 18px;
	-webkit-mask-image: linear-gradient(90deg, transparent 30%, #000); mask-image: linear-gradient(90deg, transparent 30%, #000);
}
body.app .dh > *, body.app .page-title > *, body.app .vhead > * { position: relative; z-index: 1; }
body.app .dh h1, body.app .page-title h3, body.app .vhead h1 { color: #fff; }
body.app .dh__eyebrow, body.app .page-title h3::before { color: #ff9a6b; }
body.app .dh__sub, body.app .vhead p, body.app .page-title h3 small { color: #b9bcc6; }
body.app .vhead .chip { background: rgba(255,255,255,.08); color: #fff; }
/* BOTONES DENTRO DE LA BANDA */
body.app .dh .btn-default:not(.btn-xs) { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: #fff; box-shadow: none !important; }
body.app .dh .btn-default:not(.btn-xs):hover { background: rgba(255,255,255,.14); color: #fff; }

/* INICIO: LOS INDICADORES SE MONTAN SOBRE LA BANDA */
body.app .dh { padding-bottom: 92px; margin-bottom: 0; align-items: flex-start; }
body.app .db-kpis { position: relative; z-index: 2; margin: -70px 18px 18px; }

/* --- BOTONES PRINCIPALES EN NARANJA DE MARCA --- */
body.app .btn-primary:not(.btn-xs), body.app .btn-success:not(.btn-xs), body.app .btn-warning:not(.btn-xs) { border: 0; background: var(--grad); color: #fff; box-shadow: 0 10px 20px -12px rgba(246,83,28,.9) !important; }
body.app .btn-primary:not(.btn-xs):hover, body.app .btn-success:not(.btn-xs):hover, body.app .btn-warning:not(.btn-xs):hover,
body.app .btn-primary:not(.btn-xs):focus, body.app .btn-success:not(.btn-xs):focus { filter: brightness(1.06); color: #fff; }

/* --- INDICADORES CON ACENTO DE COLOR --- */
.db-kpi { box-shadow: 0 18px 36px -24px rgba(23,24,28,.45); border-color: transparent; }
.db-kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--kpi, var(--or)); }
.db-kpi__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.db-kpi__ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--kpi-soft, #feeae2); color: var(--kpi, var(--or)); }
.db-kpi__ico .vp-ico { width: 18px; height: 18px; }
.db-kpi--or   { --kpi: #f6531c; --kpi-soft: #feeae2; }
.db-kpi--blue { --kpi: #3d6fb6; --kpi-soft: #e6eefa; }
.db-kpi--amb  { --kpi: #d98a00; --kpi-soft: #fff1d6; }
.db-kpi--grn  { --kpi: #1f9d6b; --kpi-soft: #e3f4ec; }

/* --- TARJETAS: CABECERA CON ACENTO --- */
.db-card, body.app .x_panel { border-color: transparent; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 30px -24px rgba(23,24,28,.35); }
body.app .db-card__head h2, body.app .x_title h2 { display: flex; align-items: center; gap: 10px; }
body.app .db-card__head h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--grad); }
body.app .x_title h2 .fa { background: #feeae2; color: var(--or); }

/* --- TABLAS: CABECERA CON FONDO SUAVE --- */
body.app .table > thead > tr > th { background: #f6f7fb; border-bottom: 0; }
body.app .table > thead > tr > th:first-child { border-radius: 10px 0 0 10px; }
body.app .table > thead > tr > th:last-child { border-radius: 0 10px 10px 0; }
body.app .db-table thead th { color: var(--mut); }

@media (max-width: 980px) {
  body.app .dh, body.app .page-title, body.app .vhead { padding: 22px 20px; }
  body.app .dh { padding-bottom: 84px; }
  body.app .db-kpis { margin: -64px 10px 16px; }
}

/* ======================================================================
   TABLAS CON MAS CARACTER: cabecera grafito, filas alternas, hover naranja
   ====================================================================== */
body.app .table, body.app .db-table--rows { border-collapse: separate; border-spacing: 0; }
body.app .table > thead > tr > th, body.app .db-table--rows thead th {
	padding: 11px 12px; border: 0; background: var(--gr2); color: #c9ccd5;
	font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
body.app .table > thead > tr > th:first-child, body.app .db-table--rows thead th:first-child { border-radius: 10px 0 0 10px; }
body.app .table > thead > tr > th:last-child, body.app .db-table--rows thead th:last-child { border-radius: 0 10px 10px 0; }

/* FILAS ALTERNAS */
body.app .table > tbody > tr:nth-of-type(even) > td, body.app .table > tbody > tr:nth-of-type(even) > th,
body.app .db-table--rows tbody tr:nth-of-type(even) td { background: #f7f8fb; }
body.app .table > tbody > tr > td, body.app .table > tbody > tr > th, body.app .db-table--rows tbody td { border-bottom: 1px solid #eef0f5; transition: background .15s; }
body.app .table > tbody > tr > td:first-child, body.app .table > tbody > tr > th:first-child, body.app .db-table--rows tbody td:first-child { border-radius: 10px 0 0 10px; }
body.app .table > tbody > tr > td:last-child, body.app .db-table--rows tbody td:last-child { border-radius: 0 10px 10px 0; }

/* HOVER: TINTE NARANJA Y BARRA A LA IZQUIERDA */
body.app .table > tbody > tr:hover > td, body.app .table > tbody > tr:hover > th, body.app .db-table--rows tbody tr:hover td { background: #fff3ed; }
body.app .table > tbody > tr:hover > :first-child, body.app .db-table--rows tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--or); }

/* NUMERO DE FILA (#) EN PILDORA */
body.app .table > tbody > tr > th[scope=row] { font-size: 12px; font-weight: 600; color: var(--mut); }
body.app .table > tbody > tr > th[scope=row]::before { content: none; }

/* TABLAS VACIAS: QUE NO PAREZCA UN HUECO */
body.app .table > tbody:empty::after { content: "Sin registros"; display: block; padding: 14px 12px; font-size: 13px; color: var(--mut); }

/* MENU ENTERO DE ARRIBA ABAJO Y PEGADO A LA IZQUIERDA (SIN MARGEN NI ESQUINAS REDONDEADAS) */
body.app { padding: 0; gap: 0; }
body.app .side { top: 0; height: 100vh; border-radius: 0; box-shadow: none; }
body.app .app__main { padding: 16px 16px 16px 24px; }
@media (max-width: 980px) {
  body.app .side { left: 0; top: 0; bottom: 0; height: 100vh; height: 100dvh; box-shadow: 0 30px 60px -20px rgba(0,0,0,.35); }
  body.app .app__main { padding: 12px; }
}

/* EL MENU SIEMPRE A LA VISTA: FIJO A LA IZQUIERDA MIENTRAS SE HACE SCROLL EN EL CONTENIDO */
@media (min-width: 981px) {
  body.app { display: block; }
  body.app .side { position: fixed; left: 0; top: 0; bottom: 0; width: 268px; height: 100vh; z-index: 30; }
  body.app .app__main { margin-left: 268px; min-height: 100vh; }
}

/* ======================================================================
   Backups (views/view_backups.php)
   ====================================================================== */
.bk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bk-span { grid-column: 1 / -1; }
.bk-pct { font-size: 22px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.bk-bar { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.bk-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--or); transition: width .6s var(--ease); }
.bk--ok .bk-bar i { background: var(--ok); }
.bk--bad .bk-bar i { background: var(--bad); }
.bk--bad #bkTexto { color: var(--bad); }
.bk-meta, .bk-nota { margin: 0; font-size: 13px; color: var(--mut); }
.bk-avisos { margin: 0; padding: 10px 14px 10px 30px; border-radius: 12px; background: var(--or-soft); color: var(--or-ink); font-size: 13px; }
.bk-alert { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.bk-alert--bad { background: var(--bad-soft); color: var(--bad); }
.bk-vacio { margin: 0; padding: 18px 0; color: var(--mut); font-size: 14px; }
.bk-fich { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; color: var(--txt); }
.bk-acc { display: flex; gap: 6px; justify-content: flex-end; }
.bk-acc .btn { display: inline-flex; align-items: center; gap: 5px; margin: 0; }
.bk-acc .vp-ico { width: 14px; height: 14px; }
.bk-lista { margin: 0; padding-left: 18px; font-size: 14px; color: var(--txt); line-height: 1.8; }
.bk-form { display: grid; gap: 12px; }
.bk-form label { display: grid; gap: 4px; margin: 0; font-size: 13px; font-weight: 500; color: var(--txt); }
.bk-form .btn { justify-self: start; }
.bk-msg { margin: 0; font-size: 13px; min-height: 1em; }
.bk-msg--ok { color: var(--ok); }
.bk-msg--bad { color: var(--bad); }
@media (max-width: 900px) { .bk-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .bk-acc { flex-direction: column; align-items: flex-end; } .bk-fich { display: none; } }
