/**
 * MANITAS PLATFORM – APP MODERNA
 * Archivo: assets/css/manitas-app-modern.css
 * Versión: 2.1.0
 * Alcance: capa exclusivamente visual. No modifica flujos, shortcodes, rutas ni datos.
 */

:root{
  --mta-green:#80c342;
  --mta-green-strong:#56a51c;
  --mta-green-deep:#18852a;
  --mta-teal:#005c67;
  --mta-teal-deep:#00464f;
  --mta-teal-soft:#e8f6f7;
  --mta-bg:#f4f7f9;
  --mta-bg-soft:#f8fafc;
  --mta-card:#ffffff;
  --mta-text:#122033;
  --mta-muted:#66768a;
  --mta-line:#e3eaf0;
  --mta-success:#16a34a;
  --mta-warning:#f59e0b;
  --mta-danger:#dc2626;
  --mta-info:#2389d7;
  --mta-purple:#7558d6;
  --mta-radius-sm:12px;
  --mta-radius:18px;
  --mta-radius-lg:24px;
  --mta-shadow-sm:0 4px 14px rgba(18,32,51,.055);
  --mta-shadow:0 10px 28px rgba(18,32,51,.075);
  --mta-shadow-lg:0 20px 48px rgba(18,32,51,.11);
  --mta-header-h:76px;
  --mta-mobile-nav-h:72px;
}

html{background:var(--mta-bg)}
body.manitas-app{
  color:var(--mta-text)!important;
  background:
    radial-gradient(circle at 100% 0,rgba(128,195,66,.09),transparent 24rem),
    linear-gradient(180deg,#fbfdfd 0,var(--mta-bg) 38%,#f7fafb 100%)!important;
  font-family:Inter,"Plus Jakarta Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif!important;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
body.manitas-app,body.manitas-app *{box-sizing:border-box}
body.manitas-app img{max-width:100%;height:auto}
body.manitas-app a{transition:color .16s ease,background .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease}
body.manitas-app button,body.manitas-app input,body.manitas-app select,body.manitas-app textarea{font:inherit}

/* ===== ESTRUCTURA GLOBAL: conserva el HTML existente ===== */
body.manitas-app main,
body.manitas-app .site-main,
body.manitas-app #primary,
body.manitas-app .entry-content{
  color:var(--mta-text);
}
body.manitas-app .entry-content>.elementor,
body.manitas-app .entry-content>.wp-block-group,
body.manitas-app .entry-content>[class*="manitas"],
body.manitas-app .entry-content>[class*="mta-"]{
  width:100%;
}

/* ===== CABECERA ===== */
body.manitas-app .mx-appbar{
  height:var(--mta-header-h)!important;
  background:rgba(255,255,255,.96)!important;
  border-bottom:1px solid var(--mta-line)!important;
  box-shadow:0 4px 20px rgba(18,32,51,.045)!important;
  backdrop-filter:blur(16px) saturate(140%);
}
body.manitas-app .mx-appbar__inner{
  max-width:1440px!important;
  min-height:var(--mta-header-h)!important;
  padding:9px clamp(14px,2.2vw,30px)!important;
  gap:14px!important;
  color:var(--mta-text)!important;
}
body.manitas-app .mx-brand-img,
body.manitas-app .mx-brand-img--big{
  width:auto!important;
  height:56px!important;
  max-width:170px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  object-fit:contain!important;
  box-shadow:none!important;
}
body.manitas-app .mx-brand{min-width:112px!important}
body.manitas-app .mx-user-pill{
  margin-left:auto;
  max-width:260px!important;
  min-height:42px;
  padding:8px 14px!important;
  border:1px solid var(--mta-line)!important;
  border-radius:14px!important;
  background:#fff!important;
  color:var(--mta-text)!important;
  box-shadow:var(--mta-shadow-sm);
  font-size:13px!important;
  font-weight:750!important;
}
body.manitas-app .mx-user-pill .mx-dot{
  width:9px!important;height:9px!important;
  background:var(--mta-green)!important;
  box-shadow:0 0 0 4px rgba(128,195,66,.14);
}
body.manitas-app .mx-top-actions{gap:8px!important}
body.manitas-app .mx-btn-top{
  min-width:42px;
  min-height:42px;
  padding:8px 12px!important;
  border:1px solid var(--mta-line)!important;
  border-radius:13px!important;
  background:#fff!important;
  color:var(--mta-text)!important;
  box-shadow:none!important;
  font-weight:800!important;
}
body.manitas-app .mx-btn-top:hover{
  border-color:rgba(128,195,66,.55)!important;
  background:#f5fbef!important;
  color:var(--mta-teal)!important;
  transform:translateY(-1px);
  box-shadow:var(--mta-shadow-sm)!important;
}
body.manitas-app .mx-ico{display:inline-flex;align-items:center;justify-content:center}
body.manitas-app .mx-ico svg{width:20px;height:20px;display:block}
body.manitas-app .ma-bell{position:relative!important}
body.manitas-app #ma-unread-badge{
  top:-5px!important;right:-5px!important;
  min-width:19px!important;height:19px!important;
  padding:0 5px!important;
  background:#e11d2e!important;color:#fff!important;
  border:2px solid #fff!important;font-size:10px!important;
  box-shadow:0 3px 8px rgba(225,29,46,.25)!important;
}

/* ===== MENÚ LATERAL / DRAWER ===== */
body.manitas-app .mx-menu{
  width:300px!important;
  min-width:280px!important;
  padding:12px!important;
  border:1px solid rgba(0,92,103,.12)!important;
  border-radius:20px!important;
  background:linear-gradient(180deg,var(--mta-teal) 0,var(--mta-teal-deep) 100%)!important;
  box-shadow:0 24px 60px rgba(0,52,59,.24)!important;
  overflow:hidden;
}
body.manitas-app .mx-menu:before{
  content:"";display:block;height:3px;margin:-12px -12px 12px;
  background:linear-gradient(90deg,var(--mta-green),#36c969,var(--mta-green));
}
body.manitas-app .mx-menu .mx-menu-muted{
  padding:7px 10px 8px!important;
  color:rgba(255,255,255,.63)!important;
  font-size:10px!important;
  font-weight:900!important;
  letter-spacing:.12em!important;
  text-transform:uppercase;
}
body.manitas-app .mx-menu a{
  min-height:45px;
  margin:3px 0;
  padding:10px 12px!important;
  gap:11px!important;
  border:1px solid transparent;
  border-radius:12px!important;
  color:#fff!important;
  font-size:13px!important;
  font-weight:750!important;
}
body.manitas-app .mx-menu a:hover,
body.manitas-app .mx-menu a:focus-visible{
  background:rgba(255,255,255,.105)!important;
  border-color:rgba(255,255,255,.12)!important;
  transform:translateX(2px);
}
body.manitas-app .mx-menu a.is-active{
  background:linear-gradient(135deg,var(--mta-green),#4fbd3f)!important;
  border-color:rgba(255,255,255,.25)!important;
  box-shadow:0 9px 20px rgba(20,116,33,.26);
}
body.manitas-app .mx-menu-icon{
  display:inline-flex;align-items:center;justify-content:center;
  width:24px;height:24px;flex:0 0 24px;color:currentColor;
}
body.manitas-app .mx-menu-icon svg{width:20px;height:20px;display:block;stroke:currentColor}
body.manitas-app .mx-menu .mx-sep{background:rgba(255,255,255,.13)!important;margin:9px 6px!important}
body.manitas-app .mx-menu .mx-menu-logout{color:#ffb6b6!important}
body.manitas-app .mx-overlay{background:rgba(4,22,27,.42)!important;backdrop-filter:blur(5px)!important}

/* ===== NAVEGACIÓN INFERIOR MÓVIL ===== */
body.manitas-app .mx-footerbar{
  background:rgba(255,255,255,.97)!important;
  border-top:1px solid var(--mta-line)!important;
  box-shadow:0 -9px 28px rgba(18,32,51,.08)!important;
  backdrop-filter:blur(15px) saturate(145%);
}
body.manitas-app .mx-footerbar__inner{
  max-width:640px!important;
  min-height:var(--mta-mobile-nav-h);
  padding:7px 10px calc(7px + env(safe-area-inset-bottom))!important;
  gap:5px!important;
}
body.manitas-app .mx-footer-link{
  min-height:55px;
  padding:6px 4px!important;
  border:0!important;
  border-radius:14px!important;
  background:transparent!important;
  color:#6a798a!important;
  font-size:10.5px!important;
  font-weight:750!important;
}
body.manitas-app .mx-footer-link:hover{background:#f2f7f3!important;color:var(--mta-teal)!important}
body.manitas-app .mx-footer-link .mx-icon{
  display:flex!important;align-items:center;justify-content:center;
  width:27px;height:27px;margin:0 0 3px!important;
}
body.manitas-app .mx-footer-link .mx-icon svg{width:22px;height:22px;stroke:currentColor;display:block}
body.manitas-app .mx-footer-link.is-active{
  background:#eff9e8!important;
  color:var(--mta-green-deep)!important;
  font-weight:900!important;
}
body.manitas-app .mx-footer-link.is-active .mx-icon{
  width:31px;height:31px;border-radius:50%;
  color:#fff!important;background:linear-gradient(135deg,var(--mta-green),var(--mta-green-deep));
  box-shadow:0 6px 15px rgba(67,157,38,.28);
}
body.manitas-app .mx-footer-link.is-active .mx-icon svg{width:18px;height:18px}

/* ===== COMPONENTES COMUNES ===== */
body.manitas-app :where(.card,.mta-card,.manitas-card,[class*="__card"],[class*="-card"]){
  border-color:var(--mta-line)!important;
}
body.manitas-app :where(.mta-card,.manitas-card,.mp-card,.mh-card,.mt-card,.mj-card,.mc-card,.ms-card,.mi-card,.mtr-card){
  background:var(--mta-card)!important;
  border:1px solid var(--mta-line)!important;
  border-radius:var(--mta-radius)!important;
  box-shadow:var(--mta-shadow-sm)!important;
  color:var(--mta-text)!important;
}
body.manitas-app :where(.mta-card,.manitas-card,.mp-card,.mh-card,.mt-card,.mj-card,.mc-card,.ms-card,.mi-card,.mtr-card):hover{
  box-shadow:var(--mta-shadow)!important;
}
body.manitas-app :where(h1,h2,h3,h4,h5,h6){color:var(--mta-text)}
body.manitas-app :where(p,.muted,[class*="muted"],[class*="subtitle"],[class*="subtext"]){color:var(--mta-muted)}

/* Botones */
body.manitas-app :where(button,input[type="submit"],input[type="button"],.button,.btn,[class*="-btn"],[class*="__button"]){
  min-height:42px;
  border-radius:12px!important;
  font-weight:800!important;
}
body.manitas-app :where(.button-primary,.btn-primary,.primary,[class*="btn-primary"],[class*="button-primary"],button[type="submit"],input[type="submit"]){
  border-color:transparent!important;
  background:linear-gradient(135deg,var(--mta-green),var(--mta-green-strong))!important;
  color:#fff!important;
  box-shadow:0 7px 16px rgba(72,154,37,.18)!important;
}
body.manitas-app :where(.button-primary,.btn-primary,.primary,[class*="btn-primary"],[class*="button-primary"],button[type="submit"],input[type="submit"]):hover{
  filter:brightness(.97);transform:translateY(-1px);box-shadow:0 10px 22px rgba(72,154,37,.25)!important;
}
body.manitas-app :where(.btn-secondary,.button-secondary,[class*="btn-secondary"],[class*="button-secondary"]){
  background:#fff!important;color:var(--mta-teal)!important;border:1px solid #bed4d8!important;
}
body.manitas-app :where(.btn-danger,.button-danger,[class*="danger"]){background:#fff1f2!important;color:var(--mta-danger)!important;border-color:#fecdd3!important}

/* Formularios */
body.manitas-app :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
  min-height:46px;
  padding:10px 13px!important;
  border:1px solid #d9e3ea!important;
  border-radius:12px!important;
  background:#fff!important;
  color:var(--mta-text)!important;
  box-shadow:0 1px 2px rgba(18,32,51,.025)!important;
  outline:none!important;
}
body.manitas-app textarea{min-height:110px;resize:vertical}
body.manitas-app :where(input,select,textarea):focus{
  border-color:var(--mta-green)!important;
  box-shadow:0 0 0 4px rgba(128,195,66,.14)!important;
}
body.manitas-app :where(label,.form-label,[class*="label"]){color:#334155}

/* Tablas */
body.manitas-app table{width:100%;border-collapse:separate;border-spacing:0;background:#fff;color:var(--mta-text)}
body.manitas-app th{background:#f3f7f8!important;color:#415165!important;font-size:12px;text-transform:none;letter-spacing:.01em}
body.manitas-app th,body.manitas-app td{padding:12px 14px!important;border-color:var(--mta-line)!important}
body.manitas-app tbody tr:hover td{background:#fbfdfb!important}

/* Badges y avisos */
body.manitas-app :where(.badge,[class*="badge"],[class*="status"],[class*="estado"]){border-radius:999px!important;font-weight:800!important}
body.manitas-app :where(.alert,.notice,[class*="alert"],[class*="notice"]){border-radius:14px!important;border-width:1px!important;box-shadow:none!important}

/* Pestañas */
body.manitas-app :where(.tabs,[class*="tabs"]){border-color:var(--mta-line)!important}
body.manitas-app :where(.tab,[class*="tab-"]){border-radius:10px!important}
body.manitas-app :where(.tab.active,.tab.is-active,[class*="tab-"][class*="active"]){background:#eff9e8!important;color:var(--mta-green-deep)!important}

/* Avatares e imágenes */
body.manitas-app :where(.avatar,[class*="avatar"],[class*="profile-photo"]){border:3px solid #fff!important;box-shadow:0 0 0 1px var(--mta-line),var(--mta-shadow-sm)!important}

/* ===== HOME / OFICINA / DASHBOARDS EXISTENTES ===== */
body.manitas-app :where(.mta-wrap,.manitas-wrap,.mp-wrap,.mt-wrap,.mj-wrap,.mc-wrap,.ms-wrap,.mi-wrap,.mtr-wrap,[class*="dashboard"],[class*="office"]){
  max-width:1440px!important;
  margin-left:auto!important;margin-right:auto!important;
}
body.manitas-app :where(.mta-wrap,.manitas-wrap,.mp-wrap,.mt-wrap,.mj-wrap,.mc-wrap,.ms-wrap,.mi-wrap,.mtr-wrap){
  padding-left:clamp(12px,2vw,26px)!important;
  padding-right:clamp(12px,2vw,26px)!important;
}
body.manitas-app :where(.hero,[class*="hero"],[class*="welcome"]){
  border-radius:var(--mta-radius-lg)!important;
}
body.manitas-app :where([class*="metric"],[class*="stat"],[class*="kpi"]){
  background:#fff!important;color:var(--mta-text)!important;border-color:var(--mta-line)!important;
}
body.manitas-app :where([class*="quick"],[class*="access"] a,[class*="shortcut"]){
  border-radius:14px!important;
}

/* Neutraliza restos oscuros sin tocar estados semánticos */
body.manitas-app :where(section,article,div,aside,form)[style*="background:#0"],
body.manitas-app :where(section,article,div,aside,form)[style*="background: #0"],
body.manitas-app :where(section,article,div,aside,form)[style*="background-color:#0"],
body.manitas-app :where(section,article,div,aside,form)[style*="background-color: #0"]{
  background:#fff!important;color:var(--mta-text)!important;
}
body.manitas-app :where(section,article,div,aside,form)[style*="color:#fff"],
body.manitas-app :where(section,article,div,aside,form)[style*="color: #fff"]{color:var(--mta-text)!important}

/* Mantiene oscuros solo los elementos institucionales necesarios */
body.manitas-app .mx-menu,
body.manitas-app .mx-menu *,
body.manitas-app [class*="sidebar"]:not(.wp-block-group),
body.manitas-app [class*="drawer"]{color:#fff}

/* ===== CHAT ===== */
body.manitas-app :where([class*="chat"]){--chat-line:var(--mta-line)}
body.manitas-app :where([class*="chat"] [class*="message"],[class*="chat"] [class*="bubble"]){
  border-radius:16px!important;
}
body.manitas-app :where([class*="chat"] .mine,[class*="chat"] .outgoing,[class*="message--me"]){
  background:linear-gradient(135deg,#e6f8df,#d8f1e5)!important;color:#173323!important;
}
body.manitas-app :where([class*="chat"] .theirs,[class*="chat"] .incoming,[class*="message--other"]){
  background:#fff!important;color:var(--mta-text)!important;border:1px solid var(--mta-line)!important;
}

/* ===== MODALES ===== */
body.manitas-app :where(.modal,[class*="modal"],[class*="dialog"]){color:var(--mta-text)}
body.manitas-app :where(.modal-content,[class*="modal-content"],[class*="dialog-content"]){
  background:#fff!important;border:1px solid var(--mta-line)!important;border-radius:20px!important;box-shadow:var(--mta-shadow-lg)!important;
}

/* ===== RESPONSIVE ===== */
@media (min-width:901px){
  body.manitas-app{padding-top:var(--mta-header-h)!important;padding-bottom:24px!important}
  body.manitas-app .mx-footerbar{display:none!important}
  body.manitas-app .mx-menu{right:0!important;left:auto!important}
}
@media (max-width:900px){
  :root{--mta-header-h:68px}
  body.manitas-app{padding-top:var(--mta-header-h)!important;padding-bottom:calc(var(--mta-mobile-nav-h) + env(safe-area-inset-bottom))!important}
  body.manitas-app .mx-appbar__inner{min-height:var(--mta-header-h)!important;padding:7px 11px!important}
  body.manitas-app .mx-brand-img,body.manitas-app .mx-brand-img--big{height:48px!important;max-width:132px!important}
  body.manitas-app .mx-user-pill{display:none!important}
  body.manitas-app .mx-btn-top--logout{display:none!important}
  body.manitas-app .mx-btn-label{display:none!important}
  body.manitas-app .mx-btn-top{padding:8px!important}
  body.manitas-app .mx-menu{
    top:0!important;left:0!important;right:auto!important;bottom:0!important;
    width:min(84vw,320px)!important;max-width:320px!important;
    padding:16px 12px calc(20px + env(safe-area-inset-bottom))!important;
    border:0!important;border-radius:0 22px 22px 0!important;
  }
  body.manitas-app .mx-menu:before{margin:-16px -12px 14px}
}
@media (max-width:540px){
  body.manitas-app :where(.mta-wrap,.manitas-wrap,.mp-wrap,.mt-wrap,.mj-wrap,.mc-wrap,.ms-wrap,.mi-wrap,.mtr-wrap){padding-left:10px!important;padding-right:10px!important}
  body.manitas-app :where(.mta-card,.manitas-card,.mp-card,.mh-card,.mt-card,.mj-card,.mc-card,.ms-card,.mi-card,.mtr-card){border-radius:15px!important}
  body.manitas-app .mx-footerbar__inner{gap:1px!important;padding-left:5px!important;padding-right:5px!important}
  body.manitas-app .mx-footer-link{font-size:9.5px!important}
}

@media (prefers-reduced-motion:reduce){
  body.manitas-app *,body.manitas-app *:before,body.manitas-app *:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}
