:root{
  --primary-color:#111111;
  --secondary-color:#188b1f;
  --secondary-dark:#0c5e14;
  --white-color:#ffffff;
  --bg-color:#f3f4ef;
  --text:#1d2a1d;
  --muted:#667267;
  --border:#e6eadf;
  --danger:#c0392b;
  --danger-soft:#fdecea;
  --shadow-soft:0 18px 40px rgba(0,0,0,.12);
  --shadow-card:0 20px 45px rgba(0,0,0,.10);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Arial,Helvetica,sans-serif;
  color:var(--primary-color);
  background:
      repeating-linear-gradient(-45deg, rgba(75,95,73,.09) 0px, rgba(75,95,73,.09) 2px, transparent 2px, transparent 22px),
      var(--bg-color);
  min-height:100vh;
  overflow-x:hidden;
  position:relative;
}
body::before{
  content:"";
  position:fixed;
  inset:auto auto 0 0;
  width:min(44vw, 520px);
  height:min(58vh, 540px);
  background:
      radial-gradient(ellipse at 20% 80%, rgba(28,126,36,.10), transparent 55%),
      radial-gradient(ellipse at 30% 90%, rgba(28,126,36,.12), transparent 45%);
  pointer-events:none;
  z-index:0;
}
body::after{
  content:"";
  position:fixed;
  left:-70px;
  bottom:-90px;
  width:420px;
  height:420px;
  border-radius:50%;
  border:6px solid rgba(126,146,122,.18);
  border-right-color:transparent;
  border-top-color:transparent;
  transform:rotate(15deg);
  box-shadow:-55px -12px 0 -2px rgba(126,146,122,.16), -108px -24px 0 -4px rgba(126,146,122,.13);
  pointer-events:none;
  z-index:0;
}
img{max-width:100%;display:block}
a{text-decoration:none}
.login-body{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;position:relative;z-index:1}
.login-wrap{width:100%;max-width:460px}
.login-card,.welcome-card,.search-panel,.dashboard-panel,.empty-card,.loading-card,.product-card,.mini-card,.hero-card,.actions-panel{background:rgba(255,255,255,.94);border-radius:24px;box-shadow:var(--shadow-card);border:1px solid rgba(20,65,31,.05)}
.login-card{padding:24px}
.login-logo-wrap{display:flex;justify-content:center;margin-bottom:12px}
.login-logo{width:min(100%,260px);object-fit:contain}
.login-title{margin:0;font-size:1.8rem;text-align:center;color:#1f1f1f}
.login-subtitle{margin:8px 0 20px;color:var(--muted);text-align:center;line-height:1.45}
.stack-lg > div{margin-bottom:14px}
label,.search-label{display:block;font-size:.95rem;font-weight:700;color:#1f1f1f;margin-bottom:8px}
input{width:100%;padding:15px 16px;border-radius:16px;border:2px solid rgba(24,139,31,.65);font-size:1rem;background:#fff;outline:none;box-shadow:0 8px 18px rgba(24,139,31,.08)}
input:focus{border-color:var(--secondary-color);box-shadow:0 0 0 4px rgba(24,139,31,.12)}
.btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:18px;padding:12px 16px;font-weight:700;cursor:pointer;text-transform:uppercase;letter-spacing:.03em}
.btn-primary,.btn-stock{color:var(--white-color);background:linear-gradient(180deg, #189522 0%, var(--secondary-color) 55%, var(--secondary-dark) 100%);box-shadow:var(--shadow-soft)}
.btn-dark{background:linear-gradient(180deg, #2c2c2c 0%, #161616 100%);color:#fff}
.btn-block{width:100%}
.btn-sm{padding:10px 14px;border-radius:14px;font-size:.92rem}
.btn.is-open{filter:saturate(1.1)}
.flash{padding:12px 14px;border-radius:16px;margin:0 0 16px}
.flash.ok{background:#eaf7ee;color:#156a34}
.flash.err{background:var(--danger-soft);color:#8b2319}
.app-shell{position:relative;z-index:1;max-width:900px;margin:0 auto;padding:28px 16px 40px}
.app-header{display:flex;flex-direction:column;gap:14px}
.header-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.hero-card{padding:14px;border-radius:28px}
.hero-card-small{width:min(100%,360px)}
.hero-logo{width:100%;height:auto;border-radius:18px}
.welcome-card{padding:20px;background:linear-gradient(135deg,#1a7a21 0%,#0c5e14 100%);color:#fff}
.eyebrow{text-transform:uppercase;letter-spacing:.08em;font-size:.78rem;opacity:.9;margin-bottom:6px}
.welcome-card h1{margin:0;font-size:1.6rem;line-height:1.15}
.welcome-card p{margin:8px 0 0;opacity:.94}
.main-content{margin-top:16px;display:flex;flex-direction:column;gap:14px}
.actions-panel,.search-panel,.dashboard-panel{padding:18px}
.dashboard-panel{overflow:hidden}
.dash-section-block + .dash-section-block{margin-top:16px;padding-top:16px;border-top:1px solid #e8ece2}
.dash-section-title{font-size:1.25rem;font-weight:800;color:#1f1f1f;margin-bottom:12px;text-transform:uppercase;letter-spacing:.04em}
.mini-card{padding:14px 15px;background:#fafcf8;border-radius:18px;box-shadow:none;border:1px solid var(--border)}
.dashboard-cards{display:grid;grid-template-columns:1fr;gap:12px}
.simple-card-title{font-size:1.05rem;font-weight:800;color:#1f1f1f;line-height:1.25;margin-bottom:8px}
.simple-card-meta{font-size:.94rem;color:var(--muted);line-height:1.45;margin-bottom:8px}
.simple-card-badges{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.mini-badge{display:inline-flex;align-items:center;justify-content:center;padding:7px 10px;border-radius:999px;background:#eaf6ed;color:#176231;font-weight:800;font-size:.88rem}
.mini-badge.gold{background:#fff5dd;color:#946200}
.mini-note{padding:9px 11px;background:#fff;border:1px dashed #d9e2d1;border-radius:14px;color:#455245;font-size:.92rem;line-height:1.45;margin-bottom:10px}
.simple-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}
.simple-list li{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;padding-top:8px;border-top:1px solid #edf1e8;font-size:.92rem}
.simple-list span{color:#334133;line-height:1.35}
.simple-list b{white-space:nowrap;color:#1f1f1f}
.empty-inline{padding:16px;border-radius:16px;background:#f7faf4;color:var(--muted);text-align:center}
.search-box{position:relative}
.search-input{padding:18px 18px;font-size:1.08rem;border-radius:22px}
.help-text{margin:10px 0 0;color:var(--muted);font-size:.94rem;line-height:1.45}
.results-wrap{display:flex;flex-direction:column;gap:12px}
.empty-state{min-height:280px}
.empty-card,.loading-card{padding:26px 22px;text-align:center}
.empty-card.compact{min-height:auto}
.empty-icon{font-size:2rem;margin-bottom:10px}
.empty-card h2,.results-header h2{margin:0 0 8px;font-size:1.25rem;color:#1f1f1f}
.empty-card p,.results-header p{margin:0;color:var(--muted);line-height:1.5}
.results-header{padding:2px 4px}
.results-header span{color:var(--secondary-color)}
.cards-grid{display:grid;grid-template-columns:1fr;gap:12px}
.product-card{padding:18px;background:rgba(255,255,255,.95)}
.product-card.no-stock{border-color:#f1d4d1;background:linear-gradient(180deg,#fff 0%,#fff9f8 100%)}
.product-name{font-size:1.15rem;font-weight:800;line-height:1.3;color:#1f1f1f;margin-bottom:14px;text-transform:uppercase}
.product-meta{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.meta-box{background:#f8fbf6;border:1px solid var(--border);border-radius:18px;padding:14px}
.meta-label{font-size:.82rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px}
.meta-value{font-size:1.3rem;font-weight:800;color:var(--text);line-height:1.1}
.meta-value.danger,.meta-value.muted{color:var(--danger)}
@media (min-width: 768px){
  .app-shell{padding:34px 20px 46px}
  .dashboard-cards,.cards-grid{grid-template-columns:1fr 1fr}
}
@media (max-width: 640px){
  .app-shell{padding:20px 12px 32px}
  .header-top{flex-direction:column;align-items:stretch}
  .hero-card-small{width:100%}
  .btn-sm{align-self:flex-end}
}
@media (max-width: 520px){
  .product-meta{grid-template-columns:1fr 1fr}
  .meta-box{padding:12px}
  .meta-value{font-size:1.15rem}
}

.pdf-badge{background:linear-gradient(180deg,#1c2220 0%,#0f1311 100%);color:#fff;border:none;text-decoration:none;box-shadow:0 8px 18px rgba(0,0,0,.14)}
.pdf-badge:hover{filter:brightness(1.05);transform:translateY(-1px)}
.pdf-badge.disabled{background:#edf0e8;color:#7b8576;box-shadow:none;pointer-events:none}


.action-buttons-panel{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.catalog-digital-btn{
  font-size: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  text-transform: none !important;
}


.global-message-card{
  margin:0 0 14px;
  padding:14px 18px;
  background:linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,252,246,.96) 100%);
  border:1px solid rgba(24,139,31,.18);
  border-left:8px solid var(--secondary-color);
  border-radius:20px;
  box-shadow:var(--shadow-card);
}
.global-message-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin:0 0 8px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(24,139,31,.10);
  color:var(--secondary-dark);
  font-weight:700;
  font-size:.82rem;
  letter-spacing:.02em;
  text-transform:none;
}
.global-message-text{
  color:#1f2b1f;
  font-size:1rem;
  line-height:1.5;
  font-weight:700;
  white-space:pre-line;
}
@media (max-width:640px){
  .global-message-card{padding:12px 14px;border-radius:16px}
  .global-message-text{font-size:.96rem;line-height:1.45}
}

.inline-proforma-action {
  display: inline-flex;
  margin: 0;
}
.inline-proforma-action button {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.pay-badge {
  background: #dff3e8;
  color: #135733;
  text-decoration: none;
}
.cancel-badge {
  background: #fdeaea;
  color: #9a2d2d;
}

/* Agrupación mensual de proformas y pedidos */
.dashboard-month-group {
  border: 1px solid rgba(25, 135, 84, 0.18);
  border-radius: 16px;
  background: #fff;
  margin-bottom: 14px;
  overflow: hidden;
}
.dashboard-month-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  cursor: pointer;
  background: #eefaf3;
  color: #145c35;
  font-weight: 800;
}
.dashboard-month-summary b {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #198754;
  color: #fff;
  font-size: 13px;
}
.dashboard-month-group .dashboard-cards {
  padding: 14px;
}


/* ===== 1.0.62 CLIENTES PREMIUM UI - mantiene catálogo físico paralelo ===== */
:root{
  --charito:#076b2a;
  --charito-2:#004c20;
  --charito-soft:#edf6ef;
  --ink:#10251a;
  --premium-line:rgba(7,107,42,.14);
  --premium-shadow:0 20px 55px rgba(10,32,18,.12);
  --premium-shadow-soft:0 10px 28px rgba(10,32,18,.08);
}
body.premium-client{
  font-family:Inter,Montserrat,Arial,Helvetica,sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(7,107,42,.10), transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(7,107,42,.08), transparent 34%),
    linear-gradient(135deg,#f8faf8 0%,#eef3ef 100%);
}
body.premium-client::before{opacity:.7}
.premium-client .app-shell{max-width:1240px;padding:18px 14px 46px}
.premium-topbar{position:sticky;top:8px;z-index:50;margin-bottom:18px}
.premium-topbar-inner{display:flex;align-items:center;justify-content:space-between;gap:14px;background:rgba(255,255,255,.88);backdrop-filter:blur(18px);border:1px solid var(--premium-line);box-shadow:var(--premium-shadow);border-radius:26px;padding:12px 14px}
.premium-logo{width:210px;max-width:42vw;height:auto;object-fit:contain}
.premium-nav{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.premium-chip{display:inline-flex;align-items:center;gap:8px;border:1px solid rgba(7,107,42,.12);background:#fff;color:var(--ink);border-radius:999px;padding:10px 13px;font-weight:800;font-size:.9rem;box-shadow:0 8px 22px rgba(0,0,0,.05);text-decoration:none;text-transform:none;letter-spacing:0}
.premium-chip.primary{background:linear-gradient(135deg,var(--charito),var(--charito-2));color:#fff;border-color:transparent}
.premium-chip.danger{background:#111;color:#fff;border-color:#111}
.premium-grid-hero{display:grid;grid-template-columns:minmax(280px,1fr) minmax(280px,1.1fr);gap:18px;margin-bottom:18px}
.premium-welcome{position:relative;overflow:hidden;border-radius:28px;padding:26px;background:linear-gradient(135deg,#007a2e,#003f1c);color:#fff;box-shadow:var(--premium-shadow)}
.premium-welcome:after{content:"";position:absolute;inset:auto -18% -55% 28%;height:190px;background:radial-gradient(ellipse at center,rgba(255,255,255,.18),transparent 62%);transform:rotate(-12deg)}
.premium-kicker{font-size:.76rem;text-transform:uppercase;letter-spacing:.12em;font-weight:900;opacity:.86;margin-bottom:8px}
.premium-welcome h1{font-size:clamp(2rem,4vw,3.4rem);margin:0;line-height:.98}
.premium-welcome p{margin:12px 0 0;font-weight:700;opacity:.92}
.status-pill{display:inline-flex;align-items:center;gap:8px;margin-top:18px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.22);border-radius:999px;padding:8px 12px;font-weight:800;font-size:.86rem}.status-pill:before{content:"";width:9px;height:9px;border-radius:50%;background:#3dff72}
.premium-alert{display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid rgba(7,107,42,.22);background:rgba(255,255,255,.88);border-radius:28px;padding:22px 24px;box-shadow:var(--premium-shadow-soft)}
.premium-alert h2{margin:0 0 6px;color:var(--charito);font-size:1.25rem}.premium-alert p{margin:0;line-height:1.55;color:#2d3b33;font-weight:700}.alert-icon{width:42px;height:42px;border-radius:16px;display:grid;place-items:center;background:var(--charito);color:#fff;font-weight:900;flex:0 0 auto}.fabric-stack{width:118px;height:86px;border-radius:22px;background:linear-gradient(135deg,#e9efe9,#fff);position:relative;flex:0 0 auto}.fabric-stack:before,.fabric-stack:after{content:"";position:absolute;left:22px;right:18px;height:16px;border-radius:999px;background:#355845;box-shadow:0 22px 0 #aeb9b1,0 44px 0 #0d6b31;top:14px}.fabric-stack:after{left:44px;right:8px;background:#dfe4df;box-shadow:0 22px 0 #4a6957;opacity:.9}
.premium-actions{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:16px;margin:0 0 18px;padding:0;background:transparent;border:0;box-shadow:none}
.premium-card{position:relative;min-height:190px;overflow:hidden;background:rgba(255,255,255,.93);border:1px solid rgba(7,107,42,.12);box-shadow:var(--premium-shadow-soft);border-radius:28px;padding:22px;color:var(--ink);display:flex;flex-direction:column;justify-content:space-between;text-decoration:none;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.premium-card:hover{transform:translateY(-2px);box-shadow:var(--premium-shadow);border-color:rgba(7,107,42,.24)}
.premium-card.big{min-height:230px}.premium-card .icon{width:58px;height:58px;border-radius:18px;background:linear-gradient(135deg,var(--charito),var(--charito-2));color:#fff;display:grid;place-items:center;font-size:1.6rem;box-shadow:0 15px 30px rgba(7,107,42,.22)}
.premium-card h3{margin:18px 0 8px;font-size:1.35rem;line-height:1.18}.premium-card p{margin:0;color:#5a695e;font-weight:600;line-height:1.45}.premium-card .go{align-self:flex-start;margin-top:18px;background:var(--charito);color:#fff;border-radius:999px;padding:10px 13px;font-weight:900;font-size:.85rem}.premium-card.feature:after{content:"";position:absolute;inset:auto 0 0 0;height:72px;background:linear-gradient(0deg,rgba(7,107,42,.14),transparent)}.premium-card.denim:after{background:linear-gradient(0deg,rgba(14,50,96,.20),transparent)}
.premium-small-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:14px;margin-bottom:18px}.premium-small{min-height:126px;border-radius:24px;padding:18px;background:#fff;border:1px solid var(--premium-line);box-shadow:var(--premium-shadow-soft);text-decoration:none;color:var(--ink);display:flex;gap:14px;align-items:flex-start}.premium-small b{display:block;margin-bottom:6px}.premium-small span{font-size:.86rem;color:#647169;line-height:1.35}.premium-small .mini-ico{width:42px;height:42px;border-radius:15px;background:var(--charito-soft);display:grid;place-items:center;color:var(--charito);font-weight:900;flex:0 0 auto}
.action-buttons-panel{display:none!important}.dashboard-panel.simple-dashboard{border-radius:28px;border-color:var(--premium-line);box-shadow:var(--premium-shadow-soft);background:rgba(255,255,255,.94)}
@media (max-width:900px){.premium-grid-hero{grid-template-columns:1fr}.premium-actions{grid-template-columns:1fr}.premium-small-grid{grid-template-columns:1fr 1fr}.premium-topbar-inner{border-radius:20px;align-items:flex-start}.premium-logo{width:170px}.premium-nav{gap:6px}.premium-chip{font-size:.82rem;padding:9px 10px}.premium-alert{align-items:flex-start}.fabric-stack{display:none}}
@media (max-width:560px){.premium-client .app-shell{padding:10px 8px 30px}.premium-topbar{top:6px}.premium-topbar-inner{padding:10px;gap:10px}.premium-logo{width:145px;max-width:48vw}.premium-nav{display:grid;grid-template-columns:1fr 1fr;width:100%}.premium-chip{justify-content:center}.premium-grid-hero{gap:12px}.premium-welcome{border-radius:22px;padding:22px}.premium-alert{border-radius:22px;padding:18px}.premium-actions,.premium-small-grid{gap:10px}.premium-card{border-radius:22px;min-height:170px;padding:18px}.premium-card.big{min-height:190px}.premium-small-grid{grid-template-columns:1fr}.premium-small{border-radius:20px}.main-content{gap:10px}}


/* ===== 1.0.63 HARDENING CLIENTES ===== */
body.premium-client .premium-topbar,
body.premium-client .premium-topbar * { box-sizing:border-box; }
body.premium-client .premium-topbar { position:sticky; top:8px; z-index:999; }
body.premium-client .main-content { min-height:calc(100vh - 140px); }
body.premium-client .premium-actions a,
body.premium-client .premium-small-grid a,
body.premium-client .premium-small-grid button { color:inherit; }
@media (max-width:760px){
  body.premium-client { overflow-x:hidden; }
  .premium-client .app-shell{max-width:none;width:100%;padding:10px 10px calc(86px + env(safe-area-inset-bottom));}
  .premium-client .premium-topbar{top:6px;margin-bottom:12px}
  .premium-client .premium-topbar-inner{border-radius:22px;padding:10px;align-items:center}
  .premium-client .premium-logo{width:144px;max-width:45vw}
  .premium-client .premium-nav{gap:6px;overflow-x:auto;flex-wrap:nowrap;justify-content:flex-start;padding-bottom:2px;scrollbar-width:none}
  .premium-client .premium-nav::-webkit-scrollbar{display:none}
  .premium-client .premium-chip{white-space:nowrap;min-height:38px;padding:9px 11px;font-size:.82rem}
  .premium-client .premium-grid-hero{grid-template-columns:1fr;gap:10px}
  .premium-client .premium-welcome,.premium-client .premium-alert{border-radius:22px;padding:18px}
  .premium-client .premium-actions{grid-template-columns:1fr;gap:10px}
  .premium-client .premium-card.big{min-height:150px}
  .premium-client .premium-small-grid{grid-template-columns:1fr;gap:10px}
}

/* CLIENTES 1.0.68 llegadas */
.product-card .arrival-box{font-size:.92rem}.other-card .arrival-box{font-size:.92rem}
