/*
 * P-GLOBAL FINAL — Total Look Signature para el ERP legacy activo.
 *
 * Esta capa se carga desde el sidebar, después de las hojas de cada módulo.
 * Dashboard se excluye explícitamente y POS no usa .shell/sidebar.
 * Solo redefine presentación: no altera estructura, flujos ni estados.
 */
body:not(.dashboard-signature){
  --color-bg:var(--tl-color-ivory);
  --color-sidebar:var(--tl-color-charcoal);
  --color-surface:var(--tl-color-paper);
  --color-surface-soft:#faf7f1;
  --color-text:var(--tl-color-text);
  --color-text-muted:var(--tl-color-text-muted);
  --color-border:var(--tl-color-border);
  --color-border-strong:var(--tl-color-border-strong);
  --color-primary:var(--tl-color-gold-dark);
  --color-primary-strong:#60491f;
  --color-primary-soft:var(--tl-color-gold-soft);
  --color-accent:var(--tl-color-gold);
  --color-success:var(--tl-color-success);
  --color-success-soft:var(--tl-color-success-soft);
  --color-warning:var(--tl-color-warning);
  --color-warning-soft:var(--tl-color-warning-soft);
  --color-error:var(--tl-color-error);
  --color-error-soft:var(--tl-color-error-soft);
  --radius-xs:var(--tl-radius-xs);
  --radius-sm:var(--tl-radius-sm);
  --radius-md:var(--tl-radius-md);
  --radius-lg:var(--tl-radius-lg);
  --radius-pill:var(--tl-radius-pill);
  --shadow-sm:var(--tl-shadow-sm);
  --shadow-md:var(--tl-shadow-md);
  --shadow-lg:var(--tl-shadow-lg);
  --transition-fast:var(--tl-transition-fast);
  --transition-base:var(--tl-transition-base);
  --rp-purple:var(--tl-color-gold-dark);
  --rp-ink:var(--tl-color-text);
  --rp-muted:var(--tl-color-text-muted);
  --rp-line:var(--tl-color-border);
  --rp-bg:var(--tl-color-ivory);
  background:var(--tl-color-ivory);
  color:var(--tl-color-text);
  font-family:var(--tl-font-sans);
}

body:not(.dashboard-signature) .shell{background:var(--tl-color-ivory)}
body:not(.dashboard-signature) .content{color:var(--tl-color-text)}
body:not(.dashboard-signature) main.content h1,
body:not(.dashboard-signature) main.content h2,
body:not(.dashboard-signature) main.content h3{color:var(--tl-color-text);font-family:var(--tl-font-serif);font-weight:400;letter-spacing:-.02em}
body:not(.dashboard-signature) main.content h1{letter-spacing:-.03em}
body:not(.dashboard-signature) .section-kicker,
body:not(.dashboard-signature) [class$="-kicker"],
body:not(.dashboard-signature) [class$="-eyebrow"],
body:not(.dashboard-signature) .eyebrow{color:var(--tl-color-gold-dark)}
body:not(.dashboard-signature) main.content a{color:var(--tl-color-burgundy)}
body:not(.dashboard-signature) main.content a:hover{color:#572131}

/* Sidebar Signature compartido. */
body:not(.dashboard-signature) .sidebar{background:linear-gradient(180deg,#10100f 0,#181817 62%,#101010 100%);box-shadow:8px 0 28px rgba(17,17,16,.1)}
body:not(.dashboard-signature) .sidebar-brand{border-bottom-color:rgba(185,151,77,.18)}
body:not(.dashboard-signature) .sidebar-brand::after{width:54px;background:var(--tl-color-gold)}
body:not(.dashboard-signature) .sidebar-group-label{color:#827a6c}
body:not(.dashboard-signature) .sidebar-group-admin{border-top-color:rgba(185,151,77,.13)}
body:not(.dashboard-signature) .sidebar-link{color:#bcb6aa}
body:not(.dashboard-signature) a.sidebar-link:hover{background:rgba(185,151,77,.09);color:#fff}
body:not(.dashboard-signature) .sidebar-link.is-active{background:linear-gradient(90deg,rgba(185,151,77,.2),rgba(185,151,77,.05));box-shadow:inset 0 0 0 1px rgba(185,151,77,.18);color:#fff}
body:not(.dashboard-signature) .sidebar-link.is-active .nav-icon{color:#d8bd7d}
body:not(.dashboard-signature) .sidebar-avatar{border:1px solid rgba(185,151,77,.3);background:#25231e;color:#e6cc8f}
body:not(.dashboard-signature) .sidebar-user{border-top-color:rgba(185,151,77,.14)}

/* Superficies, filtros y tarjetas: misma estructura, acabado Signature. */
body:not(.dashboard-signature) .panel,
body:not(.dashboard-signature) .card,
body:not(.dashboard-signature) [class$="-card"],
body:not(.dashboard-signature) [class$="-panel"]{border-color:var(--tl-color-border);background-color:var(--tl-color-paper);box-shadow:var(--tl-shadow-sm)}
body:not(.dashboard-signature) .panel{border-radius:var(--tl-radius-md)}
body:not(.dashboard-signature) .filters-panel,
body:not(.dashboard-signature) [class*="-filters"],
body:not(.dashboard-signature) [class*="-toolbar"]{border-color:var(--tl-color-border)}
body:not(.dashboard-signature) .metric-card,
body:not(.dashboard-signature) .metric,
body:not(.dashboard-signature) .ds-stat-card,
body:not(.dashboard-signature) .summary-grid>*,
body:not(.dashboard-signature) .metrics>*{border-color:var(--tl-color-border);background:var(--tl-color-paper);box-shadow:var(--tl-shadow-sm)}
body:not(.dashboard-signature) .metric-card.metric-primary,
body:not(.dashboard-signature) .rewards-highlight{border-color:#d8c18d;background:linear-gradient(180deg,#fffaf0,var(--tl-color-paper) 72%)}

/* Acciones. Se conservan tamaños y disposición de cada módulo. */
body:not(.dashboard-signature) .primary-action,
body:not(.dashboard-signature) .btn.primary,
body:not(.dashboard-signature) .add-product-action,
body:not(.dashboard-signature) main.content a.primary,
body:not(.dashboard-signature) main.content button.primary{border-color:#9b7831;background:linear-gradient(105deg,#c9aa63,#ae873d);box-shadow:0 7px 18px rgba(130,103,45,.18);color:#19160f}
body:not(.dashboard-signature) .primary-action:hover,
body:not(.dashboard-signature) .btn.primary:hover,
body:not(.dashboard-signature) .add-product-action:hover,
body:not(.dashboard-signature) main.content a.primary:hover,
body:not(.dashboard-signature) main.content button.primary:hover{border-color:#806126;background:linear-gradient(105deg,#d4b66f,#b79043);color:#15130e}
body:not(.dashboard-signature) .secondary-action,
body:not(.dashboard-signature) .secondary,
body:not(.dashboard-signature) .btn:not(.primary){border-color:var(--tl-color-border-strong);background:var(--tl-color-paper);color:var(--tl-color-text);box-shadow:var(--tl-shadow-sm)}
body:not(.dashboard-signature) .secondary-action:hover,
body:not(.dashboard-signature) .secondary:hover,
body:not(.dashboard-signature) .btn:not(.primary):hover{border-color:var(--tl-color-gold);background:#fffaf0;color:var(--tl-color-text)}
body:not(.dashboard-signature) .danger-action,
body:not(.dashboard-signature) button.danger{background:var(--tl-color-error);color:#fff}
body:not(.dashboard-signature) .text-action{color:var(--tl-color-burgundy)}

/* Campos operativos. */
body:not(.dashboard-signature) main.content label{color:#615c55}
body:not(.dashboard-signature) main.content input,
body:not(.dashboard-signature) main.content select,
body:not(.dashboard-signature) main.content textarea{border-color:var(--tl-color-border-strong);background:var(--tl-color-paper);color:var(--tl-color-text)}
body:not(.dashboard-signature) main.content input:hover,
body:not(.dashboard-signature) main.content select:hover,
body:not(.dashboard-signature) main.content textarea:hover{border-color:#b9aa95}
body:not(.dashboard-signature) main.content input:focus,
body:not(.dashboard-signature) main.content select:focus,
body:not(.dashboard-signature) main.content textarea:focus{border-color:var(--tl-color-gold);box-shadow:0 0 0 3px rgba(185,151,77,.16);outline:0}
body:not(.dashboard-signature) main.content input:disabled,
body:not(.dashboard-signature) main.content select:disabled,
body:not(.dashboard-signature) main.content textarea:disabled{background:#eee9e1;color:#8a837a}

/* Tablas, tabs y paginación. */
body:not(.dashboard-signature) .table-wrap,
body:not(.dashboard-signature) .inventory-table-wrap,
body:not(.dashboard-signature) .table-scroll,
body:not(.dashboard-signature) .report-table-card{border-color:var(--tl-color-border);border-radius:var(--tl-radius-md);background:var(--tl-color-paper);box-shadow:var(--tl-shadow-sm)}
body:not(.dashboard-signature) main.content th{border-color:var(--tl-color-border);background:#f2eadc;color:#625b51}
body:not(.dashboard-signature) main.content td{border-color:var(--tl-color-border)}
body:not(.dashboard-signature) main.content tbody tr:hover{background:#fcf8f0}
body:not(.dashboard-signature) .tab-button.is-active,
body:not(.dashboard-signature) .catalog-tab.is-active{border-bottom-color:var(--tl-color-gold);color:var(--tl-color-gold-dark)}
body:not(.dashboard-signature) .configuration-tabs a.is-active,
body:not(.dashboard-signature) .audit-quick a.is-active{border-color:#2b2924;background:#23221f;color:#fff}
body:not(.dashboard-signature) .pagination a.is-current,
body:not(.dashboard-signature) .pagination a.active,
body:not(.dashboard-signature) .notification-pages a.active{border-color:var(--tl-color-gold-dark);background:var(--tl-color-gold-dark);color:#fff}

/* Badges, estados y alertas conservan semántica funcional. */
body:not(.dashboard-signature) .badge-primary,
body:not(.dashboard-signature) .state-reserved{background:var(--tl-color-gold-soft);color:var(--tl-color-gold-dark)}
body:not(.dashboard-signature) .state-success,
body:not(.dashboard-signature) .badge-success{background:var(--tl-color-success-soft);color:var(--tl-color-success)}
body:not(.dashboard-signature) .state-warning,
body:not(.dashboard-signature) .badge-warning{background:var(--tl-color-warning-soft);color:var(--tl-color-warning)}
body:not(.dashboard-signature) .state-danger,
body:not(.dashboard-signature) .badge-error{background:var(--tl-color-error-soft);color:var(--tl-color-error)}
body:not(.dashboard-signature) .state-confirmed{background:var(--tl-color-info-soft);color:var(--tl-color-info)}
body:not(.dashboard-signature) .state-neutral,
body:not(.dashboard-signature) .badge:not(.badge-primary):not(.badge-success):not(.badge-warning):not(.badge-error){background:#efebe4;color:var(--tl-color-text-muted)}
body:not(.dashboard-signature) .flash.ok,
body:not(.dashboard-signature) .alert.success,
body:not(.dashboard-signature) .alert-success,
body:not(.dashboard-signature) .inventory-flash.ok{border-color:#bbddca;background:var(--tl-color-success-soft);color:var(--tl-color-success)}
body:not(.dashboard-signature) .flash.error,
body:not(.dashboard-signature) .alert.error,
body:not(.dashboard-signature) .alert.danger,
body:not(.dashboard-signature) .alert-error,
body:not(.dashboard-signature) .inventory-flash.error{border-color:#efc8cc;background:var(--tl-color-error-soft);color:var(--tl-color-error)}
body:not(.dashboard-signature) .alert-warning,
body:not(.dashboard-signature) .inventory-flash.warning{border-color:#eccb9f;background:var(--tl-color-warning-soft);color:#815012}

/* Modales y estados vacíos. */
body:not(.dashboard-signature) dialog{border-color:var(--tl-color-border);border-radius:var(--tl-radius-lg);background:var(--tl-color-paper);box-shadow:var(--tl-shadow-lg);color:var(--tl-color-text)}
body:not(.dashboard-signature) dialog::backdrop{background:rgba(15,14,12,.68)}
body:not(.dashboard-signature) .empty-state,
body:not(.dashboard-signature) [class$="-empty"]{color:var(--tl-color-text-muted)}
body:not(.dashboard-signature) .empty-icon,
body:not(.dashboard-signature) .report-icon{background:var(--tl-color-gold-soft);color:var(--tl-color-gold-dark)}

/* Módulos que conservaban acentos morados codificados directamente. */
body:not(.dashboard-signature) .prototype-notice,
body:not(.dashboard-signature) .smart-purchase-feedback,
body:not(.dashboard-signature) .order-number-field{border-color:rgba(185,151,77,.3);background:var(--tl-color-gold-soft)}
body:not(.dashboard-signature) .unit-price-summary{border-color:rgba(185,151,77,.3);background:linear-gradient(135deg,#fffaf0,#f6edda)}
body:not(.dashboard-signature) .report-icon{background:var(--tl-color-gold-soft)}
body:not(.dashboard-signature) .reports-main{background:var(--tl-color-ivory)}
body:not(.dashboard-signature) .rewards-pos-card{border-color:#d8c394;background:#fffaf0}

/* Centro de Marketing: conserva su composición y sustituye únicamente la paleta legacy morada. */
body:not(.dashboard-signature) .marketing-center{background:var(--tl-color-ivory);color:var(--tl-color-text)}
body:not(.dashboard-signature) .marketing-hero,
body:not(.dashboard-signature) .project-hero{background:linear-gradient(115deg,#181817,#292720 68%,#3a3223);box-shadow:0 16px 38px rgba(25,22,16,.2);color:#fff}
body:not(.dashboard-signature) main.content .marketing-hero h1,
body:not(.dashboard-signature) main.content .project-hero h1{color:#fff}
body:not(.dashboard-signature) .marketing-hero p{color:#d7d0c3}
body:not(.dashboard-signature) .marketing-hero span{color:#d8bd7d}
body:not(.dashboard-signature) .marketing-center button{background:linear-gradient(105deg,#c9aa63,#ae873d);color:#19160f}
body:not(.dashboard-signature) .marketing-center button:hover{background:linear-gradient(105deg,#d4b66f,#b79043)}
body:not(.dashboard-signature) .marketing-hero .primary{background:#d1b15f;color:#19160f}
body:not(.dashboard-signature) .marketing-nav{border-color:var(--tl-color-border);background:var(--tl-color-paper)}
body:not(.dashboard-signature) .marketing-nav a{color:var(--tl-color-text-muted)}
body:not(.dashboard-signature) .marketing-nav a.active{background:var(--tl-color-gold-soft);color:var(--tl-color-burgundy)}
body:not(.dashboard-signature) .project-grid>a,
body:not(.dashboard-signature) .arrival-grid article,
body:not(.dashboard-signature) .cards article,
body:not(.dashboard-signature) .media-grid article{border-color:var(--tl-color-border);background:var(--tl-color-paper)}
body:not(.dashboard-signature) .project-grid span,
body:not(.dashboard-signature) .arrival-grid span,
body:not(.dashboard-signature) .cards span,
body:not(.dashboard-signature) .media-grid span,
body:not(.dashboard-signature) .media-type{color:var(--tl-color-gold-dark)!important}
body:not(.dashboard-signature) .project-grid i,
body:not(.dashboard-signature) .deliverables i{background:#e8e0d2}
body:not(.dashboard-signature) .project-grid em,
body:not(.dashboard-signature) .deliverables em{background:var(--tl-color-gold)}
body:not(.dashboard-signature) .metrics a,
body:not(.dashboard-signature) .marketing-search .selection-summary{border-color:#ddc98f;background:var(--tl-color-gold-soft);color:var(--tl-color-text)}
body:not(.dashboard-signature) .metrics strong{color:var(--tl-color-gold-dark)}

/* Clasificación comercial compartida: Clientes y Rewards Cliente. */
body:not(.dashboard-signature) .client-tier{display:inline-flex;align-items:center;gap:6px;width:max-content;padding:5px 9px;border:1px solid transparent;border-radius:var(--tl-radius-pill);font-size:.68rem;font-weight:850;line-height:1.1;white-space:nowrap}
body:not(.dashboard-signature) .client-tier-icon{flex:0 0 auto;width:14px;height:14px}
body:not(.dashboard-signature) .client-tier--normal{border-color:#cddae4;background:var(--tl-color-navy-soft);color:var(--tl-color-navy)}
body:not(.dashboard-signature) .client-tier--recurrente{border-color:#ddc98f;background:var(--tl-color-gold-soft);color:var(--tl-color-gold-dark)}
body:not(.dashboard-signature) .client-tier--vip{border-color:#cba5ae;background:linear-gradient(100deg,var(--tl-color-burgundy-soft),var(--tl-color-gold-soft));color:var(--tl-color-burgundy)}

/* Acceso también forma parte de la identidad, sin afectar autenticación. */
body.login-body{background:radial-gradient(circle at 50% 0,#302b21 0,#171715 48%,#0d0d0c 100%)}
body.login-body .login-card{border-color:rgba(185,151,77,.24);background:var(--tl-color-paper);box-shadow:var(--tl-shadow-lg)}
body.login-body .brand-mark{border:1px solid #d3b76f;background:linear-gradient(145deg,#1b1b19,#302a20);box-shadow:0 10px 24px rgba(20,18,14,.28);color:#e4c984}
body.login-body .login-card h1{font-family:var(--tl-font-serif);font-weight:400}
body.login-body .login-card input{border-color:var(--tl-color-border-strong);background:#fff}
body.login-body .login-card input:focus{border-color:var(--tl-color-gold);box-shadow:0 0 0 3px rgba(185,151,77,.16)}
body.login-body .login-card button{background:linear-gradient(105deg,#c9aa63,#ae873d);color:#19160f}
body.login-body .login-card button:hover{background:linear-gradient(105deg,#d4b66f,#b79043)}

@media(max-width:1100px){
  body:not(.dashboard-signature) .order-filters{grid-template-columns:1fr 1fr}
  body:not(.dashboard-signature) .config-grid{grid-template-columns:1fr}
  body:not(.dashboard-signature) .config-card>form{grid-template-columns:1fr}
  body:not(.dashboard-signature) .config-card>form button{grid-column:auto}
}
@media(max-width:900px){
  body:not(.dashboard-signature) .mobile-menu-button{border-color:var(--tl-color-border);background:rgba(255,253,248,.96);color:var(--tl-color-text)}
}
@media(max-width:620px){
  body:not(.dashboard-signature) .inventory-pagination{flex-wrap:wrap;gap:8px 12px}
  body:not(.dashboard-signature) .migration-page .upload-panel form,
  body:not(.dashboard-signature) .migration-page .upload-panel form>*{min-width:0;max-width:100%}
  body:not(.dashboard-signature) .migration-page .upload-panel input{box-sizing:border-box;width:100%}
  body:not(.dashboard-signature) .rewards-balance-compact{grid-template-columns:1fr}
  body:not(.dashboard-signature) .rewards-balance-compact>div{min-width:0}
  body:not(.dashboard-signature) .rewards-columns,
  body:not(.dashboard-signature) .rewards-columns>*{min-width:0}
}
@media(prefers-reduced-motion:reduce){body:not(.dashboard-signature) *{transition-duration:.01ms!important}}
