/* css/mw-arcilla.css — Estilo "Arcilla" (3D suave) para todo MultiWisp.
   Se carga DE ULTIMO en index.html, despues de mw-cobros.css. No cambia HTML ni JS:
   solo pinta encima de las clases que ya existen (.mwp, .mwk, .mwd, menu y barra de arriba).
   Para volver al estilo anterior basta con quitar su <link> de index.html.

   Idea: las tarjetas parecen "infladas" (sombra clara arriba-izquierda y oscura abajo-derecha),
   los campos parecen "hundidos" (sombra hacia adentro) y los iconos son cuadritos de color con brillo.
   Funciona en claro y en oscuro (html[data-theme="dark"]). */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ===================== 1. Colores y sombras ===================== */
:root {
  --ar-bg: #e9edf7;          /* fondo de la app */
  --ar-surface: #f4f6fb;     /* tarjetas */
  --ar-pit: #e3e8f3;         /* campos hundidos */
  --ar-ink: #1e2340;
  --ar-text: #2e3560;
  --ar-muted: #565e80;
  --ar-sep: rgba(150, 163, 196, .28);
  --ar-sh-dark: rgba(150, 163, 196, .5);
  --ar-sh-light: rgba(255, 255, 255, .95);
  --ar-out: 9px 9px 20px var(--ar-sh-dark), -9px -9px 20px var(--ar-sh-light);
  --ar-out-sm: 5px 5px 12px var(--ar-sh-dark), -5px -5px 12px var(--ar-sh-light);
  --ar-in: inset 3px 3px 7px var(--ar-sh-dark), inset -3px -3px 7px var(--ar-sh-light);
  --ar-vio: #5b4bd8;  --ar-vio-l: #9a8cfa;
  --ar-tea: #0c9e74;  --ar-tea-l: #5be6ba;
  --ar-amb: #ee8a00;  --ar-amb-l: #ffcb6b;
  --ar-cor: #e0434a;  --ar-cor-l: #ff9a90;
  --ar-sky: #1f8fd6;  --ar-sky-l: #8fd3ff;
  --ar-r: 22px;       /* esquinas de las tarjetas */
}
html[data-theme="dark"] {
  --ar-bg: #181c2e;
  --ar-surface: #1f2439;
  --ar-pit: #161a2a;
  --ar-ink: #eef0fa;
  --ar-text: #cdd2ea;
  --ar-muted: #9aa1c3;
  --ar-sep: rgba(255, 255, 255, .06);
  --ar-sh-dark: rgba(0, 0, 0, .55);
  --ar-sh-light: rgba(255, 255, 255, .045);
  --ar-out: 8px 8px 18px var(--ar-sh-dark), -6px -6px 16px var(--ar-sh-light);
  --ar-out-sm: 4px 4px 10px var(--ar-sh-dark), -3px -3px 9px var(--ar-sh-light);
  --ar-in: inset 3px 3px 7px var(--ar-sh-dark), inset -2px -2px 6px var(--ar-sh-light);
  --ar-vio: #6d5df0;  --ar-vio-l: #a99cff;
}

/* Las paginas nuevas (.mwp) toman estos colores */
html .mwp {
  --mwp-bg: var(--ar-bg);
  --mwp-surface: var(--ar-surface);
  --mwp-ink: var(--ar-ink);
  --mwp-text: var(--ar-text);
  --mwp-muted: var(--ar-muted);
  --mwp-line: transparent;
  --mwp-line-2: var(--ar-sep);
  --mwp-primary: var(--ar-vio);
  --mwp-primary-dark: #4433c2;
  --mwp-ok: #0a7556;
  --mwp-err: #b4232a;
  --mwp-warn: #8a4b00;
  --mwp-warn-bg: #fff1d9;
  --mwp-warn-line: transparent;
}
html[data-theme="dark"] .mwp {
  --mwp-bg: var(--ar-bg);
  --mwp-surface: var(--ar-surface);
  --mwp-ink: var(--ar-ink);
  --mwp-text: var(--ar-text);
  --mwp-muted: var(--ar-muted);
  --mwp-line: transparent;
  --mwp-line-2: var(--ar-sep);
  --mwp-primary: #8b7cf6;
  --mwp-primary-dark: #b3a8ff;
  --mwp-ok: #4ade9f;
  --mwp-err: #ff8a8a;
  --mwp-warn: #ffc76b;
  --mwp-warn-bg: rgba(238, 138, 0, .12);
  --mwp-warn-line: transparent;
}

/* ===================== 2. Base ===================== */
body, .main-content, html[data-theme="dark"] body { background: var(--ar-bg); }
body, .mwp, .sidebar, .topbar, .topbar input, .mwp button, .mwp input, .mwp select {
  font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', system-ui, sans-serif;
}
.mwp { font-size: 14.5px; }

/* ===================== 3. Tarjetas (infladas) ===================== */
.mwk .mwk-tile,
html .mwd .mwd-card,
.mwp .mwp-table,
.mwk .mwk-list,
.mwk .mwk-sel,
.mwp .mwp-soon-panel {
  background: var(--ar-surface);
  border: 0;
  border-radius: var(--ar-r);
  box-shadow: var(--ar-out);
}
.mwp .mwp-soon-panel { border: 0; }
.mwk .mwk-hero { gap: 20px; margin-bottom: 24px; }
html .mwd .mwd-grid { gap: 22px; margin-bottom: 22px; }
html .mwd .mwd-card { padding: 20px 22px; margin-bottom: 22px; }
.mwk .mwk-tile { padding: 18px 20px; transition: transform .2s ease, box-shadow .2s ease; }
html .mwd .mwd-tile:hover { transform: translateY(-3px); border: 0; box-shadow: 12px 14px 26px var(--ar-sh-dark), -9px -9px 20px var(--ar-sh-light); }
.mwk .mwk-tile > b { font-size: 30px; font-weight: 800; line-height: 1.15; margin-top: 6px; }
.mwk .mwk-tile small { font-weight: 700; font-size: 13px; }
.mwk .mwk-tile .s { font-weight: 600; }

/* Icono de cada tarjeta de arriba: cuadrito de color con brillo, flotando */
.mwk .mwk-hero .mwk-tile small { gap: 10px; }
.mwk .mwk-hero .mwk-tile small i {
  --c1: var(--ar-vio-l); --c2: var(--ar-vio);
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none;
  color: #fff; font-size: 15px;
  background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .45), inset -2px -3px 5px rgba(0, 0, 0, .2), 3px 5px 10px color-mix(in srgb, var(--c2) 40%, transparent);
  animation: ar-flota 5s ease-in-out infinite;
}
.mwk .mwk-hero .mwk-tile:nth-child(2) small i { --c1: var(--ar-cor-l); --c2: var(--ar-cor); animation-delay: .6s; }
.mwk .mwk-hero .mwk-tile:nth-child(3) small i { --c1: var(--ar-tea-l); --c2: var(--ar-tea); animation-delay: 1.2s; }
.mwk .mwk-hero .mwk-tile:nth-child(4) small i { --c1: var(--ar-amb-l); --c2: var(--ar-amb); animation-delay: 1.8s; }
@keyframes ar-flota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .mwk .mwk-hero .mwk-tile small i { animation: none; } }

/* ===================== 4. Botones ===================== */
.mwp .mwp-btn {
  height: 42px; padding: 0 16px; border: 0; border-radius: 14px; font-weight: 700;
  background: var(--ar-surface); color: var(--ar-text); box-shadow: var(--ar-out-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.mwp .mwp-btn:hover { transform: translateY(-2px); background: var(--ar-surface); border: 0; }
.mwp .mwp-btn:active { transform: translateY(1px); box-shadow: var(--ar-in); }
.mwp .mwp-btn-primary, .mwp .mwp-btn-primary:hover {
  background: linear-gradient(145deg, #7f70f2, #5240d4); color: #fff;
  box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .35), inset -2px -3px 5px rgba(0, 0, 0, .2), 6px 8px 16px rgba(82, 64, 212, .38);
}
.mwp .mwp-btn-quiet { box-shadow: none; background: transparent; color: var(--ar-vio); }
html[data-theme="dark"] .mwp .mwp-btn-quiet { color: #b3a8ff; }
.mwp .mwp-btn-quiet:hover { box-shadow: var(--ar-out-sm); background: var(--ar-surface); }
.mwp .mwp-btn-danger { color: var(--mwp-err); }
.mwk .mwk-ok, .mwk .mwk-ok:hover {
  background: linear-gradient(145deg, var(--ar-tea-l), var(--ar-tea)); color: #fff;
  box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .35), 5px 7px 14px rgba(12, 158, 116, .32);
}

/* ===================== 5. Campos, buscadores y selectores (hundidos) ===================== */
.mwk .mwk-search input,
.mwp .mwp-search input,
.mwp .mwp-tool-select,
.mwk .mwk-tabs,
html .mwd .mwd-seg,
.topbar .search-bar {
  background: var(--ar-pit) !important; border: 0 !important; box-shadow: var(--ar-in); border-radius: 14px;
}
.mwk .mwk-search input, .mwp .mwp-search input, .mwp .mwp-tool-select { height: 42px; }
.mwk .mwk-search i { top: 14px; }
.mwk .mwk-tabs, html .mwd .mwd-seg { padding: 5px; border-radius: 16px; gap: 4px; }
.mwk .mwk-tabs button, html .mwd .mwd-seg button { border-radius: 12px; font-weight: 700; padding: 7px 14px; }
.mwk .mwk-tabs button[aria-selected="true"],
html .mwd .mwd-seg button[aria-checked="true"] {
  background: linear-gradient(145deg, #7f70f2, #5240d4); color: #fff;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, .35), 3px 5px 10px rgba(82, 64, 212, .35);
}
.mwk .mwk-tabs button[aria-selected="true"] .n { color: rgba(255, 255, 255, .85); }
.mwk .mwk-chip {
  border: 0; background: var(--ar-pit); box-shadow: var(--ar-in); color: var(--ar-muted);
  padding: 7px 14px; font-weight: 700;
}
.mwk .mwk-chip[aria-pressed="true"] {
  background: linear-gradient(145deg, #7f70f2, #5240d4); color: #fff;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, .35), 3px 5px 10px rgba(82, 64, 212, .35);
}

/* ===================== 6. Listas y filas ===================== */
.mwk .mwk-hd, .mwk .mwk-thd { background: transparent; border-bottom: 1px solid var(--ar-sep); }
.mwk .mwk-row, .mwk .mwk-trow { border-top-color: var(--ar-sep); transition: background .15s ease; }
.mwk .mwk-row:hover, .mwk .mwk-trow:hover { background: color-mix(in srgb, var(--ar-vio) 6%, var(--ar-surface)); }
.mwk .is-sel { background: color-mix(in srgb, var(--ar-vio) 10%, var(--ar-surface)) !important; }
.mwk .is-sel::before { background: linear-gradient(180deg, #9a8cfa, #5240d4); width: 4px; border-radius: 0 4px 4px 0; }

/* Avatares con relieve */
.mwk .mwk-av, html .mwd .mwd-av {
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, .6), 3px 4px 9px var(--ar-sh-dark);
}
html[data-theme="dark"] .mwk .mwk-av, html[data-theme="dark"] .mwd .mwd-av { box-shadow: inset 1px 1px 2px rgba(255, 255, 255, .12), 3px 4px 9px var(--ar-sh-dark); }
html .mwd .mwd-av { background: linear-gradient(145deg, #e3deff, #c8c0fa); color: #4b3bc4; width: 38px; height: 38px; }
html[data-theme="dark"] .mwd .mwd-av { background: linear-gradient(145deg, #3a3470, #2a2550); color: #c9c1ff; }
html .mwd .mwd-fila, html .mwd .mwd-rt, html .mwd .mwd-tarea { grid-template-columns: 40px 1fr auto; border-top-color: var(--ar-sep); }
html .mwd .mwd-rt { grid-template-columns: 14px 1fr auto; }
html .mwd .mwd-fila b, html .mwd .mwd-tarea b, html .mwd .mwd-rt b { font-weight: 700; }
html .mwd .mwd-fila.clic:hover, html .mwd .mwd-tarea:hover, html .mwd .mwd-rt:hover { background: color-mix(in srgb, var(--ar-vio) 6%, transparent); border-radius: 14px; }

/* Pastillas de estado */
.mwk .mwk-pill { font-weight: 800; padding: 2px 10px; }

/* ===================== 7. Inicio (Dashboard) ===================== */
html .mwd .mwd-h h2 { font-size: 17px; font-weight: 800; }
html .mwd .mwd-h h2 i { color: var(--ar-vio); }
html[data-theme="dark"] .mwd .mwd-h h2 i { color: #a99cff; }
/* "Para hoy": icono 3D con el color de cada tarea (--c) */
html .mwd .mwd-tarea .ic {
  width: 40px; height: 40px; border-radius: 13px; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 55%, #fff), var(--c));
  box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .4), inset -2px -3px 5px rgba(0, 0, 0, .18), 3px 5px 10px color-mix(in srgb, var(--c) 35%, transparent);
}
html .mwd .mwd-tarea .n {
  font-size: 18px; font-weight: 800; min-width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--ar-pit); box-shadow: var(--ar-in);
}
/* Routers: punto con brillo */
html .mwd .mwd-rt .dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--mwp-ok) 22%, transparent); }
html .mwd .mwd-rt.fail .dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--mwp-err) 22%, transparent); }
html .mwd .mwd-rt.off .dot { box-shadow: none; }
/* Lo cobrado: cifras grandes y barras violeta */
html .mwd .mwd-stats > div { background: var(--ar-pit); box-shadow: var(--ar-in); border-radius: 16px; padding: 12px 16px; }
html .mwd .mwd-stats b { font-size: 22px; font-weight: 800; }
html .mwd .mwd-chart .bar { fill: #8577f3; opacity: 1; }
html .mwd .mwd-chart .bar.hoy { fill: #4433c2; }
html .mwd .mwd-chart .bar:hover { fill: #5240d4; }
html[data-theme="dark"] .mwd .mwd-chart .bar { fill: #8b7cf6; }
html[data-theme="dark"] .mwd .mwd-chart .bar.hoy { fill: #b3a8ff; }
html .mwd .mwd-chart .eje { stroke: var(--ar-sep); }
html .mwd .mwd-fila .amt { font-weight: 800; }

/* ===================== 8. Planes y otras paginas .mwp ===================== */
.mwp .mwp-row + .mwp-row { border-top-color: var(--ar-sep); }
.mwp .mwp-bar { height: 10px; background: var(--ar-pit); box-shadow: inset 1px 1px 3px var(--ar-sh-dark); }
.mwp .mwp-bar .mwp-base { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 55%, #fff), var(--c)); }
.mwp .mwp-warn { border: 0; border-radius: 14px; box-shadow: inset 2px 2px 5px rgba(238, 138, 0, .18); }
.mwp .mwp-dot { width: 10px; height: 10px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.mwp .mwp-tab .mwp-ic {
  color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--c) 55%, #fff), var(--c));
  box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .4), 3px 4px 9px color-mix(in srgb, var(--c) 35%, transparent);
}

/* Panel lateral (Cobros y otras): fondo de arcilla y esquinas redondas */
.mwk .mwk-dr { background: var(--ar-bg); border-radius: 28px 0 0 28px; }
.mwk .mwk-dr-h { background: transparent; border-bottom: 1px solid var(--ar-sep); }

/* ===================== 9. Menu lateral ===================== */
:root {
  --sh-bg: var(--ar-bg);
  --sh-line: var(--ar-sep);
  --sh-text: var(--ar-text);
  --sh-muted: var(--ar-muted);
  --sh-sec: var(--ar-muted);
  --sh-hover: rgba(255, 255, 255, .5);
  --sh-on: var(--ar-surface);
  --sh-bar: var(--ar-vio);
  --sh-card: var(--ar-surface);
  --sh-card-line: transparent;
}
html[data-theme="dark"] {
  --sh-bg: var(--ar-bg);
  --sh-line: var(--ar-sep);
  --sh-hover: rgba(255, 255, 255, .04);
  --sh-bar: #a99cff;
}
.sidebar { border-right: 0; }
.sidebar .logo-text h1 { color: var(--ar-ink); font-weight: 800; }
.sidebar .logo .logo-icon {
  border-radius: 14px; color: #fff;
  background: linear-gradient(145deg, #9a8cfa, #5b4bd8);
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, .45), inset -3px -4px 7px rgba(0, 0, 0, .2), 5px 8px 16px rgba(91, 75, 216, .35);
}
.sidebar .menu > li > a { border-radius: 14px; padding: 10px 12px; font-weight: 600; }
.sidebar .menu > li > a:hover, .sidebar .has-submenu.active > a { color: var(--ar-ink); }
.sidebar .menu > li > a.active, .sidebar .submenu li a.active {
  color: var(--ar-vio); background: var(--ar-surface); box-shadow: var(--ar-out-sm);
}
html[data-theme="dark"] .sidebar .menu > li > a.active, html[data-theme="dark"] .sidebar .submenu li a.active { color: #c9c1ff; }
.sidebar .menu > li > a.active::before, .sidebar .submenu li a.active::before { display: none; }
.sidebar .submenu { border-left: 2px solid var(--ar-sep); }
.sidebar .submenu li a { border-radius: 12px; font-weight: 600; }
.sidebar .menu-badge.n { background: var(--ar-pit); color: var(--ar-muted); box-shadow: var(--ar-in); }
.sidebar .menu-badge { background: linear-gradient(145deg, var(--ar-cor-l), var(--ar-cor)); box-shadow: 2px 3px 6px rgba(224, 67, 74, .3); }
.sidebar .sidebar-footer { border-top: 1px solid var(--ar-sep); }
.mw-routers { border-radius: 14px; background: var(--ar-pit); box-shadow: var(--ar-in); color: var(--ar-tea); font-weight: 700; }
html[data-theme="dark"] .mw-routers { color: #4ade9f; }
.mw-me .av { background: linear-gradient(145deg, #9a8cfa, #5b4bd8); box-shadow: inset 1px 1px 2px rgba(255, 255, 255, .4), 2px 3px 7px rgba(91, 75, 216, .35); }
.mw-me .info b { color: var(--ar-ink); }
.mw-me button:hover { color: var(--ar-ink); }

/* ===================== 10. Barra de arriba ===================== */
.topbar, html[data-theme="dark"] .topbar { background: var(--ar-bg); border-bottom: 0; }
.topbar .breadcrumb, .topbar .sidebar-toggle, .topbar .topbar-item,
html[data-theme="dark"] .topbar .breadcrumb, html[data-theme="dark"] .sidebar-toggle, html[data-theme="dark"] .topbar-item { color: var(--ar-text); }
.topbar .breadcrumb { font-weight: 700; }
.topbar .breadcrumb i { color: var(--ar-vio); }
.topbar .search-bar input { background: transparent !important; color: var(--ar-text); }
.topbar .isp-selector, html[data-theme="dark"] .isp-selector {
  background: var(--ar-surface); border: 0; border-radius: 14px; box-shadow: var(--ar-out-sm); color: var(--ar-text); font-weight: 700;
}
.topbar .user-avatar {
  border-radius: 14px; background: linear-gradient(145deg, #9a8cfa, #5b4bd8); color: #fff;
  box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .4), 4px 6px 12px rgba(91, 75, 216, .35);
}
.topbar .notification-badge { background: linear-gradient(145deg, var(--ar-cor-l), var(--ar-cor)); }
.user-dropdown, .notification-panel,
html[data-theme="dark"] .user-dropdown, html[data-theme="dark"] .notification-panel {
  background: var(--ar-surface); border: 0; border-radius: 18px; box-shadow: var(--ar-out);
}

/* ===================== 11. Menu lateral MORADO =====================
   El menu va en violeta (claro y oscuro) para que la app no se vea toda blanca.
   Para volver al menu claro, borra este bloque completo (hasta el 12). */
:root, html[data-theme="dark"] {
  --sh-bg: linear-gradient(180deg, #5b4bd8 0%, #4434b8 55%, #35289a 100%);
  --sh-line: rgba(255, 255, 255, .12);
  --sh-text: #f1efff;
  --sh-muted: #cfc8ff;
  --sh-sec: #b9b0ff;
  --sh-hover: rgba(255, 255, 255, .10);
  --sh-on: rgba(255, 255, 255, .18);
  --sh-bar: #ffffff;
}
html[data-theme="dark"] { --sh-bg: linear-gradient(180deg, #3a2f8f 0%, #2a2170 55%, #1f1858 100%); }
.sidebar { background: var(--sh-bg); box-shadow: 6px 0 24px rgba(68, 52, 184, .25); }
.sidebar .logo-text h1 { color: #fff; }
.sidebar .logo-text p { color: var(--sh-muted); }
.sidebar .logo .logo-icon { background: linear-gradient(145deg, #ffffff, #e4dfff); color: #5b4bd8;
  box-shadow: inset 2px 2px 3px #fff, inset -2px -3px 5px rgba(91, 75, 216, .25), 4px 6px 14px rgba(20, 10, 80, .35); }
.sidebar .logo .logo-icon i { color: #5b4bd8; }
.sidebar .menu > li > a, .sidebar .menu > li > a i, .sidebar .submenu li a { color: var(--sh-text); }
.sidebar .submenu li a { color: var(--sh-muted); }
.sidebar .menu > li > a:hover, .sidebar .submenu li a:hover, .sidebar .has-submenu.active > a { color: #fff; background: var(--sh-hover); }
.sidebar .menu > li > a.active, .sidebar .submenu li a.active,
html[data-theme="dark"] .sidebar .menu > li > a.active, html[data-theme="dark"] .sidebar .submenu li a.active {
  color: #fff; background: var(--sh-on);
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, .25), 4px 6px 14px rgba(20, 10, 80, .3);
}
.sidebar .menu > li > a.active i, .sidebar .has-submenu.active > a > i:first-child { color: #fff; }
.sidebar .submenu { border-left-color: rgba(255, 255, 255, .18); }
.sidebar .menu-badge.n { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
.sidebar .sidebar-footer { border-top-color: rgba(255, 255, 255, .12); }
.mw-routers, html[data-theme="dark"] .mw-routers { background: rgba(255, 255, 255, .12); box-shadow: inset 1px 1px 3px rgba(0, 0, 0, .2); color: #b6f7d9; }
.mw-me .info b { color: #fff; }
.mw-me .av { background: linear-gradient(145deg, #ffffff, #e4dfff); color: #5b4bd8; }
.mw-me button, .sidebar .version-info { color: var(--sh-muted); }
.mw-me button:hover { color: #fff; background: var(--sh-hover); }

/* ===================== 12. Paginas viejas: mismo estilo Arcilla =====================
   Tráfico, Mis tareas, Tickets, Reportes, Reporte financiero, Config. facturación,
   Plantillas, Equipo, Config. empresarial y Ayuda todavia usan clases viejas
   (main.css / componentes.css y un <style> propio en cada pagina). Aqui se pintan encima.
   "html body" adelante = mas fuerza que el <style> de cada pagina. */

/* 12.1 Colores viejos -> Arcilla */
html:root, html[data-theme="dark"] {
  --bg: var(--ar-bg); --panel: var(--ar-surface); --panel-2: var(--ar-pit); --panel-hover: var(--ar-pit);
  --card-bg: var(--ar-surface); --text: var(--ar-ink); --text-secondary: var(--ar-muted); --text-muted: var(--ar-muted);
  --border: var(--ar-sep); --border-light: var(--ar-sep);
  --primary: #5b4bd8; --primary-dark: #4433c2; --primary-light: #8b7cf6; --secondary: #8b7cf6;
  --topbar-bg: var(--ar-bg); --topbar-border: transparent;
}
html[data-theme="dark"] { --primary: #8b7cf6; --primary-light: #a99cff; --primary-lighter: rgba(139, 124, 246, .16); }
html:root { --primary-lighter: #ece9ff; }

/* 12.2 Encabezados: sin la caja celeste, como en las paginas nuevas */
html body .page-header, html body .tk-header, html body .rf-header, html body .rop-header, html body .hlp-header {
  background: transparent; border: 0; box-shadow: none; padding: 0; margin-bottom: 22px;
}
html body .page-header h1, html body .page-header h2, html body .page-title h1, html body .header-info h2 {
  font-size: 26px; font-weight: 800; color: var(--ar-ink); letter-spacing: -.02em;
}
html body .page-header p, html body .header-info p { color: var(--ar-muted); font-weight: 500; }
html body .page-title i, html body .page-header h1 i, html body .page-header h2 i { color: var(--ar-vio); }

/* 12.3 Tarjetas infladas (y sin la rayita de color arriba) */
html body .main-content .card,
html body .kpi-card, html body .mt-kpi, html body .tk-metric, html body .tk-sidebar-card,
html body .rop-card, html body .rop-kpi, html body .rf-kpi, html body .rf-chart-card,
html body .hlp-card, html body .hlp-faq, html body .usr-role-card, html body .info-box,
html body .table-container, html body .rf-table-wrap, html body .tk-table-wrap, html body .mt-item, html body .tk-item {
  background: var(--ar-surface); border: 0 !important; border-radius: var(--ar-r); box-shadow: var(--ar-out);
}
html body .kpi-card::before, html body .tk-metric-bar, html body .rf-kpi::before, html body .rop-kpi::before { display: none !important; }
html body .kpi-card-value, html body .mt-kpi b, html body .tk-metric-value, html body .rf-kpi-val, html body .rop-kpi b, html body .rop-kpi strong {
  font-weight: 800; color: var(--ar-ink); letter-spacing: -.02em;
}
html body .kpi-card-value { font-size: 30px; }
html body .kpi-card-label, html body .rf-kpi-lbl, html body .rop-kpi-label, html body .tk-metric-label { font-weight: 700; color: var(--ar-muted); }
/* iconos de las tarjetas: cuadrito con relieve */
html body .tk-metric-icon, html body .rf-kpi-icon, html body .hlp-card-icon, html body .mt-kpi > i, html body .mt-kpi-icon {
  border-radius: 14px !important; box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .55), 3px 5px 10px var(--ar-sh-dark);
}
html body .stats-grid, html body .mt-kpis, html body .tk-metrics, html body .rf-kpis, html body .rop-kpis { gap: 20px; }

/* 12.4 Botones */
html body .main-content .btn, html body .tk-btn, html body .rf-btn, html body .hlp-btn, html body .mt-btn {
  border: 0 !important; border-radius: 14px; font-weight: 700; min-height: 40px;
  background: var(--ar-surface); color: var(--ar-text); box-shadow: var(--ar-out-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
html body .main-content .btn:hover, html body .tk-btn:hover, html body .rf-btn:hover, html body .mt-btn:hover { transform: translateY(-2px); }
html body .main-content .btn:active, html body .tk-btn:active, html body .rf-btn:active { transform: translateY(1px); box-shadow: var(--ar-in); }
html body .main-content .btn-primary, html body .tk-btn-primary, html body .rf-btn-primary, html body .mt-btn--take, html body .hlp-btn {
  background: linear-gradient(145deg, #7f70f2, #5240d4) !important; color: #fff !important;
  box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .35), inset -2px -3px 5px rgba(0, 0, 0, .2), 6px 8px 16px rgba(82, 64, 212, .38);
}
html body .main-content .btn-secondary, html body .tk-btn-ghost, html body .rf-btn-ghost {
  background: var(--ar-surface) !important; color: var(--ar-text) !important;
}
html body .main-content .btn-danger, html body .tk-btn-danger-ghost { color: var(--mwp-err, #b4232a) !important; background: var(--ar-surface) !important; }
html body .main-content .btn-success { background: linear-gradient(145deg, var(--ar-tea-l), var(--ar-tea)) !important; color: #fff !important; }

/* 12.5 Campos hundidos */
html body .main-content .form-control, html body .main-content select,
html body .main-content input[type="text"], html body .main-content input[type="search"], html body .main-content input[type="number"],
html body .main-content input[type="email"], html body .main-content input[type="tel"], html body .main-content input[type="date"],
html body .main-content input[type="time"], html body .main-content input[type="password"], html body .main-content textarea,
html body .tk-input, html body .rf-select, html body .rop-select {
  background: var(--ar-pit) !important; border: 0 !important; border-radius: 14px; box-shadow: var(--ar-in);
  color: var(--ar-text) !important; min-height: 42px;
}
html body .main-content .form-control, html body .main-content select { padding: 8px 14px; }
html body .main-content textarea { padding: 12px 14px; }
html body .main-content .form-control:focus, html body .main-content input:focus, html body .main-content select:focus, html body .main-content textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--ar-vio) 55%, transparent); outline-offset: 1px;
}
html body .main-content label { color: var(--ar-text); font-weight: 600; }
html body .hint-text, html body .main-content small.form-text { color: var(--ar-muted); }
/* Interruptores */
html body .bs-toggle-slider { background: var(--ar-pit) !important; box-shadow: var(--ar-in); border: 0 !important; }
html body .bs-toggle input:checked + .bs-toggle-slider { background: linear-gradient(145deg, var(--ar-tea-l), var(--ar-tea)) !important; }

/* 12.6 Pestañas y chips (Mis tareas, Tickets) */
html body .mt-tabs, html body .tk-filter-chips { gap: 10px; }
html body .mt-tab, html body .tk-chip {
  border: 0 !important; border-radius: 999px; font-weight: 700; padding: 8px 16px;
  background: var(--ar-pit) !important; color: var(--ar-muted) !important; box-shadow: var(--ar-in);
}
html body .mt-tab.active, html body .tk-chip.active {
  background: linear-gradient(145deg, #7f70f2, #5240d4) !important; color: #fff !important;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, .35), 3px 5px 10px rgba(82, 64, 212, .35);
}

/* 12.7 Tablas: encabezado limpio en vez de la barra azul */
html body .main-content table thead, html body .main-content table thead tr,
html body .main-content table thead th, html body .tk-table thead th, html body .rf-table thead th, html body .usr-table thead th {
  background: transparent !important; color: var(--ar-muted) !important; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; font-size: 11.5px;
  border-bottom: 1px solid var(--ar-sep) !important;
}
html body .main-content table tbody tr { border-color: var(--ar-sep); }
html body .main-content table tbody td { border-color: var(--ar-sep) !important; }
html body .main-content table tbody tr:hover { background: color-mix(in srgb, var(--ar-vio) 6%, transparent) !important; }

/* 12.8 Ventanas (modales) */
html body .modal-content, html body .tk-modal, html body .pp-modal-box {
  background: var(--ar-bg) !important; border: 0 !important; border-radius: 26px !important; box-shadow: 0 30px 70px rgba(20, 20, 60, .35) !important;
}
html body .modal-header, html body .tk-modal-header, html body .modal-footer { border-color: var(--ar-sep) !important; background: transparent !important; }

/* 12.9 Detalles por pagina */
html body .card .table-container, html body .card .rf-table-wrap, html body .hlp-faq { box-shadow: none; background: transparent; border-radius: 0; }
html body .hlp-faq { border-bottom: 1px solid var(--ar-sep) !important; }
html body .search-input { background: transparent !important; box-shadow: none !important; border: 0 !important; }
html body .hlp-contact { background: linear-gradient(145deg, #7f70f2, #4433c2); box-shadow: 8px 12px 24px rgba(68, 51, 194, .35); border-radius: var(--ar-r); }
html body .rop-row-fill { background: linear-gradient(90deg, #9a8cfa, #5240d4); }
html body .hlp-faq-q { font-weight: 700; color: var(--ar-ink); }

/* ===================== 13. Componentes con estilo propio =====================
   Clientes, Routers, Ficha del cliente, Agregar cliente, Caja, Facturas y los paneles laterales
   tenian tarjetas planas con borde fino. Aqui toman el mismo relieve que Inicio, Cobros y Promesas.
   "html" adelante = mas fuerza que mw-ui.css y que el <style> propio de cada pagina. */

/* 13.1 Tarjetas de resumen chicas -> infladas, como las de Cobros */
html .mwl-sum { gap: 20px; }
html .mwl-stat, html .mwf-kpi, html body .summary-card {
  background: var(--ar-surface); border: 0 !important; border-radius: var(--ar-r); box-shadow: var(--ar-out); padding: 16px 18px;
}
html body .summary-card { transition: transform .2s ease, box-shadow .2s ease; }
html body .summary-card:hover { transform: translateY(-3px); box-shadow: 12px 14px 26px var(--ar-sh-dark), -9px -9px 20px var(--ar-sh-light); }
html .mwl-stat small, html .mwf-kpi small, html body .summary-label { font-weight: 700; font-size: 13px; color: var(--ar-muted); }
html .mwl-stat strong, html .mwf-kpi strong, html body .summary-value { font-weight: 800; font-size: 24px; letter-spacing: -.02em; color: var(--ar-ink); }
html .mwf-kpi.bad strong { color: var(--mwp-err); }
html .mwf-kpi.good strong { color: var(--mwp-ok); }

/* Iconos: cuadrito 3D con el color de cada uno (--c) */
html .mwl-stat .mwp-ic, html .mwr-ic, html .mwj .mwj-ic, html .mwc-node .mwp-ic, html .mwc-plan-strip .mwp-ic {
  color: #fff; border-radius: 12px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c, var(--ar-vio)) 55%, #fff), var(--c, var(--ar-vio)));
  box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .4), inset -2px -3px 5px rgba(0, 0, 0, .18), 3px 5px 10px color-mix(in srgb, var(--c, var(--ar-vio)) 35%, transparent);
}
html .mwr-ic .dot { border-color: var(--ar-surface); }
html body .summary-icon {
  border-radius: 14px !important; color: #fff !important;
  background: linear-gradient(145deg, var(--ar-vio-l), var(--ar-vio)) !important;
  box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .4), inset -2px -3px 5px rgba(0, 0, 0, .18), 3px 5px 10px rgba(91, 75, 216, .3);
}
html body .summary-card.amount .summary-icon { background: linear-gradient(145deg, var(--ar-tea-l), var(--ar-tea)) !important; box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .4), 3px 5px 10px rgba(12, 158, 116, .3); }
html body .summary-card.overdue .summary-icon { background: linear-gradient(145deg, var(--ar-cor-l), var(--ar-cor)) !important; box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .4), 3px 5px 10px rgba(224, 67, 74, .3); }
html body .summary-card.this-month .summary-icon { background: linear-gradient(145deg, var(--ar-amb-l), var(--ar-amb)) !important; box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .4), 3px 5px 10px rgba(238, 138, 0, .3); }

/* Avatares de clientes con relieve (conservan su color) */
html .mwl-av, html .mwc-avatar, html .mwf-avatar {
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 14%, var(--ar-surface)), color-mix(in srgb, var(--c) 26%, var(--ar-surface)));
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, .55), 3px 4px 9px var(--ar-sh-dark);
}
html[data-theme="dark"] .mwl-av, html[data-theme="dark"] .mwc-avatar, html[data-theme="dark"] .mwf-avatar { box-shadow: inset 1px 1px 2px rgba(255, 255, 255, .12), 3px 4px 9px var(--ar-sh-dark); }

/* 13.2 Routers: tarjetas infladas y datos hundidos */
html .mwr-grid { gap: 22px; }
html .mwr-card {
  background: var(--ar-surface); border: 0; border-radius: var(--ar-r); box-shadow: var(--ar-out); padding: 18px 20px;
  transition: transform .2s ease, box-shadow .2s ease;
}
html .mwr-card:hover { border: 0; transform: translateY(-3px); box-shadow: 12px 14px 26px var(--ar-sh-dark), -9px -9px 20px var(--ar-sh-light); }
html .mwr-card[aria-selected="true"] { box-shadow: var(--ar-out), 0 0 0 3px color-mix(in srgb, var(--ar-vio) 55%, transparent); }
html .mwr-card.is-off { background: var(--ar-surface); }
html .mwr-meta { gap: 10px; }
html .mwr-meta div { background: var(--ar-pit); box-shadow: var(--ar-in); border-radius: 14px; padding: 8px 12px; }
html .mwr-meta strong { font-weight: 800; }

/* 13.3 Ficha del cliente */
html .mwf-head {
  background: var(--ar-surface); border: 0; border-radius: var(--ar-r); box-shadow: var(--ar-out);
  position: relative; overflow: hidden; padding: 22px 24px 20px;
}
html .mwf-head::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 45%, #fff), var(--c)); }
html .mwf-kpis { gap: 20px; margin: 20px 0; }
html .mwf-grid { gap: 20px; }
html .mwf-col { gap: 20px; }
html .mwf-card, html .mwf-diff { background: var(--ar-surface); border: 0; border-radius: var(--ar-r); box-shadow: var(--ar-out); }
html .mwf-card { padding: 20px 22px; }
html .mwf-card-head h2 { font-size: 16px; font-weight: 800; }
html .mwf-card-head h2 i { color: var(--ar-vio); }
html .mwf-mini { background: var(--ar-pit); box-shadow: var(--ar-in); border-radius: 8px; }

/* 13.4 Paneles laterales (Editar router, Agregar cliente, Editar plan, ...) */
html .mwp-drawer { background: var(--ar-bg); border-radius: 28px 0 0 28px; overflow: hidden; }
html .mwp-dr-head, html .mwp-dr-foot { background: transparent; border-color: var(--ar-sep); }
html .mwp-dr-head h2 { font-weight: 800; }
html .mwp-fset { background: var(--ar-surface); border: 0; border-radius: var(--ar-r); box-shadow: var(--ar-out-sm); padding: 18px 20px; margin-bottom: 18px; }
html .mwp-fset legend { font-weight: 800; }
html .mwc-plans { gap: 16px; }
html .mwc-plan { background: var(--ar-surface); border: 0; border-radius: 18px; box-shadow: var(--ar-out-sm); }
html .mwc-plan:hover { border: 0; transform: translateY(-2px); }
html .mwc-plan[aria-checked="true"] { box-shadow: var(--ar-out-sm), 0 0 0 3px var(--c); }
html .mwc-plan-strip { background: var(--ar-surface); border: 0; border-radius: 16px; box-shadow: var(--ar-out-sm); }

/* 13.5 Caja */
html .mwj .mwj-grid { gap: 22px; margin-bottom: 22px; }
html .mwj .mwj-card, html .mwj .mwj-list { background: var(--ar-surface); border: 0; border-radius: var(--ar-r); box-shadow: var(--ar-out); }
html .mwj .mwj-card { padding: 20px 22px; }
html .mwj .mwj-h h2 { font-size: 16px; font-weight: 800; }
html .mwj .mwj-h h2 i { color: var(--ar-vio); }
html .mwj .mwj-mano { background: var(--ar-pit); border: 0; box-shadow: var(--ar-in); border-radius: 16px; }
html .mwj .mwj-mano b { font-weight: 800; }
html .mwj .mwj-dg { background: transparent; border-top: 1px solid var(--ar-sep); color: var(--ar-muted); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px; padding-top: 14px; }
html .mwj .mwj-row { border-top-color: var(--ar-sep); }
html .mwj .mwj-row:hover { background: color-mix(in srgb, var(--ar-vio) 6%, var(--ar-surface)); }
html .mwj .mwj-mes, html .mwj .mwj-dia input, html .mwj .mwj-sel { background: var(--ar-pit); border: 0; box-shadow: var(--ar-in); border-radius: 12px; }
html .mwj .mwj-cat .bar { background: var(--ar-pit); box-shadow: inset 1px 1px 3px var(--ar-sh-dark); }
html .mwj .mwj-auto { background: var(--ar-pit); }

/* 13.6 Facturas: botones de icono en las tablas (no pastillas altas) */
html body .main-content table .btn-sm { min-height: 34px; min-width: 34px; padding: 0 9px; border-radius: 11px; font-size: 13px; }
html .mwr-tabs { background: transparent; border-color: var(--ar-sep); }
