/* Dinamita POS v0 - Estilo general
   Versión: v0.1.0
   Fecha: 2025-12-15
*/
:root{
  --dp-red:#c00000;
  --dp-bg:#ffffff;
  --dp-panel:#ffffff;
  --dp-text:#111;
  --dp-muted:#777;
  --dp-border:#e6e6e6;
}
body{
  margin:0;
  font-family: Arial, sans-serif;
  background: var(--dp-bg);
  color: var(--dp-text);
}
#app{ display:flex; min-height:100vh; }
#menu{
  width:240px;
  background: var(--dp-panel);
  border-right:1px solid var(--dp-border);
  padding:12px;
  position:sticky;
  top:0;
  height:100vh;
  box-sizing:border-box;
}
#menu h2{
  margin:0 0 10px 0;
  color: var(--dp-red);
  font-size:18px;
}
#menu nav{ display:flex; flex-direction:column; gap:8px; }
#menu button{
  width:100%;
  padding:10px 12px;
  background: var(--dp-red);
  color:#fff;
  border:none;
  border-radius:10px;
  cursor:pointer;
  font-weight:800;
  text-align:left;
}
#menu button:hover{ opacity:.95; }
#content{
  flex:1;
  padding:18px;
  background: var(--dp-bg);
  box-sizing:border-box;
}
.brand{ display:flex; align-items:center; gap:10px; padding:14px 12px; border-bottom:1px solid var(--dp-border); background: var(--dp-panel); }
.brand__logo{ width:34px; height:34px; object-fit:contain; border-radius:8px; border:1px solid var(--dp-border); background:#fff; display:none; }
.brand__name{ font-weight:900; }


/* --- Menú con logo + hamburguesa (Dinamita) --- */
.dp-menuTop{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
}
.dp-menuToggle{
  width:42px;
  height:42px;
  border:1px solid var(--dp-border);
  background:#fff;
  border-radius:12px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.dp-menuToggle:hover{ background:#fafafa; }
.dp-ham{
  width:18px;
  height:12px;
  position:relative;
  display:block;
}
.dp-ham::before,.dp-ham::after,.dp-ham span{
  content:"";
  position:absolute;
  left:0;
  right:0;
  height:2px;
  background: var(--dp-red);
  border-radius:2px;
}
.dp-ham::before{ top:0; }
.dp-ham span{ top:5px; }
.dp-ham::after{ bottom:0; }

.dp-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.dp-brandLogoWrap{
  width:42px;
  height:42px;
  border-radius:12px;
  border:1px solid var(--dp-border);
  overflow:hidden;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
}
#dp-menuLogo{
  width:100%;
  height:100%;
  object-fit:cover;
  display:none;
}
#dp-menuLogoFallback{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color: var(--dp-red);
}
.dp-brandText{ min-width:0; }
#dp-menuName{
  font-weight:900;
  color:#111;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:140px;
}
.dp-brandSub{
  color: var(--dp-muted);
  font-size:12px;
  margin-top:2px;
}

.dp-nav{ display:flex; flex-direction:column; gap:8px; }
.dp-navBtn{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  background: var(--dp-red);
  color:#fff;
  border:none;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
  text-align:left;
}
.dp-navBtn .dp-navIco{
  width:22px;
  height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 22px;
}
.dp-navBtn svg{
  width:22px;
  height:22px;
  fill:none;
  stroke:#fff;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.dp-navBtn:hover{ opacity:.95; }
.dp-navBtn.active{
  outline: 2px solid rgba(192,0,0,.25);
  box-shadow: 0 0 0 3px rgba(192,0,0,.12);
}

/* Colapsado */
body.dp-menu-collapsed #menu{ width:76px; padding:12px 10px; }
body.dp-menu-collapsed .dp-brandText{ display:none; }
body.dp-menu-collapsed .dp-navBtn{ justify-content:center; padding:10px; }
body.dp-menu-collapsed .dp-navLbl{ display:none; }

/* ===== V17 UI refresh: base visual ===== */
:root{
  --dp-bg:#ffffff;
  --dp-panel:#ffffff;
  --dp-panel-soft:#fafafa;
  --dp-text:#111111;
  --dp-muted:#6b7280;
  --dp-border:#e7e7e7;
  --dp-shadow:0 10px 30px rgba(17,17,17,.05);
  --dp-shadow-soft:0 4px 14px rgba(17,17,17,.04);
  --dp-green:#198754;
  --dp-blue:#2563eb;
  --dp-amber:#d97706;
  --dp-slate:#475569;
}
html{ background:#fff; }
body{
  background:linear-gradient(180deg,#ffffff 0%,#fcfcfc 100%);
}
#menu{
  background:rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  box-shadow: 8px 0 24px rgba(17,17,17,.04);
}
#menu h2,
#dp-menuName{ letter-spacing:.2px; }
.dp-menuTop{
  padding-bottom:10px;
  border-bottom:1px solid var(--dp-border);
}
.dp-menuToggle,
.dp-brandLogoWrap{
  border-color:#ececec;
  box-shadow: var(--dp-shadow-soft);
}
.dp-menuToggle:hover,
.dp-brandLogoWrap:hover{
  transform: translateY(-1px);
}
.dp-nav{ margin-top:12px; }
.dp-navBtn{
  border-radius:14px;
  box-shadow: 0 8px 20px rgba(192,0,0,.10);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.dp-navBtn:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(192,0,0,.14);
}
.dp-navBtn.active{
  outline: 2px solid rgba(192,0,0,.16);
  box-shadow: 0 10px 22px rgba(192,0,0,.18);
}
#content{
  background:linear-gradient(180deg,#ffffff 0%,#fcfcfc 100%);
}

/* superficies reutilizables */
.card,
.dp-card,
.modal__panel,
.ticketPreview,
.stockTable,
.pick,
.crow,
.pcard,
.mcard,
.citem,
.catRow,
.dp-row,
.dp-miniBox{
  box-shadow: var(--dp-shadow-soft);
}
.card,
.dp-card,
.modal__panel,
.ticketPreview,
.pick,
.crow,
.pcard,
.mcard,
.citem,
.catRow,
.dp-row,
.dp-miniBox{
  border-color: #ececec !important;
  border-radius: 16px !important;
}
.card,
.dp-card,
.modal__panel,
.ticketPreview{
  background: linear-gradient(180deg,#ffffff 0%,#fdfdfd 100%);
}

.field input, .field select, .field textarea,
.dp-field input,
.bodSearch, .invSearch,
button.qbtn,
.x{
  border-color:#e3e3e3 !important;
  box-shadow: inset 0 1px 1px rgba(17,17,17,.02);
  background:#fff;
}
.field input:focus, .field select:focus, .field textarea:focus,
.dp-field input:focus{
  border-color: rgba(192,0,0,.45) !important;
  outline:none;
  box-shadow: 0 0 0 4px rgba(192,0,0,.08);
}

.btn,
.dp-btn,
.dp-navBtn,
button.btn,
button.dp-btn{
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.btn,
.dp-btn:not(.dp-btn--ghost){
  box-shadow: 0 10px 22px rgba(192,0,0,.14);
}
.btn:hover,
.dp-btn:hover{
  transform: translateY(-1px);
}
.btn--ghost,
.dp-btn--ghost{
  background:#fff !important;
  color:var(--dp-red) !important;
  border:1px solid rgba(192,0,0,.22) !important;
  box-shadow: var(--dp-shadow-soft) !important;
}

.pmeta .sub span,
.mmeta .sub span,
.cmeta .pill,
.stockTag,
.dp-pill{
  background:#fff;
  border-color:#ececec;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.stockTable th{
  background:#fcfcfc !important;
}
.stockTable tr:hover td{
  background:#fff9f9;
}

@media (max-width: 980px){
  #content{ padding:14px; }
  .card,
  .dp-card{ border-radius:14px !important; }
}


/* ===== V18 UI polish: global surfaces, tables, forms ===== */
#content{
  padding:22px;
}
section > header{
  margin-bottom:18px;
}
section > header h1{
  letter-spacing:.2px;
}
section > header p{
  margin:6px 0 0;
  color:var(--dp-muted);
}
.card{
  border:1px solid #ececec;
  border-radius:18px;
  background:linear-gradient(180deg,#ffffff 0%, #fdfdfd 100%);
  box-shadow: var(--dp-shadow);
}
.field input,
.field select,
.field textarea{
  background:#fff;
  border:1px solid #e4e4e7;
  transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color: rgba(192,0,0,.45);
  box-shadow: 0 0 0 4px rgba(192,0,0,.10);
}
.divider{
  background:linear-gradient(90deg, rgba(192,0,0,.10), rgba(192,0,0,.04));
}
.btn{
  box-shadow: 0 10px 22px rgba(192,0,0,.14);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(192,0,0,.18);
}
.btn--ghost{
  box-shadow:none;
  background:#fff;
}
.btn--ghost:hover{
  background:#fff6f6;
  box-shadow:0 10px 18px rgba(192,0,0,.08);
}
.tableWrap{
  border:1px solid #efefef;
  border-radius:16px;
  background:#fff;
}
.stockTable th,
.stockTable td{
  vertical-align:middle;
}
.stockTable th{
  background:#fafafa;
  color:#4b5563;
  font-weight:800;
}
.stockTable tbody tr:hover{
  background:#fff8f8;
}
@media(max-width:980px){
  #content{ padding:16px; }
  .card{ border-radius:16px; }
}


/* V20 usuarios */
.dp-userBadge{
  position:fixed; right:14px; top:14px; z-index:50;
  border:1px solid var(--dp-border); background:#fff; color:#111; border-radius:999px;
  padding:10px 14px; box-shadow: var(--dp-shadow-soft); font-weight:800; cursor:pointer;
}

.dp-authOverlay[hidden]{ display:none !important; }

.dp-authOverlay--hidden{ display:none !important; visibility:hidden !important; opacity:0 !important; pointer-events:none !important; }

.dp-authOverlay{
  position:fixed; inset:0; background:rgba(17,17,17,.38); display:flex; align-items:center; justify-content:center; z-index:120;
  padding:18px;
}
.dp-authCard{
  width:min(420px,100%); background:#fff; border:1px solid var(--dp-border); border-radius:20px; box-shadow: var(--dp-shadow); padding:22px;
}
.dp-authTitle{ font-size:22px; font-weight:900; margin-bottom:6px; }
.dp-authSub{ color:var(--dp-muted); margin-bottom:14px; }
.dp-authForm{ display:flex; flex-direction:column; gap:8px; }
.dp-authMsg{ min-height:18px; color:#b3001b; font-weight:700; font-size:13px; }
.dp-authHint{ margin-top:12px; color:var(--dp-muted); font-size:12px; }
body.dp-auth-open #menu, body.dp-auth-open #content{ filter: blur(1px); pointer-events:none; user-select:none; }
@media(max-width:700px){ .dp-userBadge{ left:86px; right:12px; top:10px; } }


/* === V22.1 menu header polish === */
.dp-menuTop{
  align-items:center;
  gap:12px;
  padding:0 0 12px;
}
#menu .dp-menuToggle,
.dp-menuToggle{
  width:44px !important;
  min-width:44px !important;
  height:44px !important;
  padding:0 !important;
  background:var(--dp-red) !important;
  border:none !important;
  border-radius:12px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-shadow:0 8px 18px rgba(192,0,0,.18) !important;
  flex:0 0 44px;
}
#menu .dp-menuToggle:hover,
.dp-menuToggle:hover{
  background:#aa0000 !important;
}
.dp-menuToggle .dp-ham::before,
.dp-menuToggle .dp-ham::after,
.dp-menuToggle .dp-ham span{
  background:#fff !important;
}
.dp-brand{
  flex:1;
  gap:12px;
}
.dp-brandLogoWrap{
  width:56px;
  height:56px;
  border-radius:14px;
  flex:0 0 56px;
}
#dp-menuLogoFallback{
  font-size:20px;
}
#dp-menuName{
  font-size:22px;
  line-height:1.05;
  max-width:120px;
}
.dp-brandSub{
  font-size:16px;
  font-weight:700;
  margin-top:4px;
}
body.dp-menu-collapsed #menu .dp-menuToggle{
  width:44px !important;
  min-width:44px !important;
}
body.dp-menu-collapsed .dp-brandLogoWrap{
  width:48px;
  height:48px;
  flex-basis:48px;
}
@media (max-width: 900px){
  .dp-brandLogoWrap{
    width:52px;
    height:52px;
    flex-basis:52px;
  }
  #dp-menuName{
    font-size:20px;
    max-width:108px;
  }
}


/* V22.2 - header vertical logo + nombre */
.dp-menuTop{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:10px;
}
.dp-menuToggle{
  align-self:flex-start;
  width:48px;
  height:48px;
}
.dp-brand{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-align:center;
}
.dp-brandLogoWrap{
  width:72px;
  height:72px;
  border-radius:18px;
}
.dp-brandText{
  min-width:0;
  width:100%;
}
#dp-menuName{
  max-width:none;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  font-size:18px;
  line-height:1.15;
  text-align:center;
  word-break:break-word;
}
.dp-brandSub{
  font-size:14px;
  text-align:center;
}
body.dp-menu-collapsed .dp-menuTop{
  align-items:center;
}
body.dp-menu-collapsed .dp-menuToggle{
  align-self:center;
}
body.dp-menu-collapsed .dp-brand{
  display:flex;
  align-items:center;
}
body.dp-menu-collapsed .dp-brandLogoWrap{
  width:42px;
  height:42px;
  border-radius:12px;
}

/* V23 - pulida general de navegación */
#app{
  background:#f7f8fb;
}
#menu{
  width:252px;
  padding:14px 12px;
  background:linear-gradient(180deg,#ffffff 0%,#fff8f6 100%);
  border-right:1px solid #eadfda;
  box-shadow:10px 0 30px rgba(55,21,13,.06);
}
#mainArea{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  background:linear-gradient(180deg,#fafafa 0%,#fff 100%);
}
.dp-appTopbar{
  position:sticky;
  top:0;
  z-index:40;
  min-height:72px;
  display:grid;
  grid-template-columns:minmax(180px,1fr) auto auto;
  gap:14px;
  align-items:center;
  padding:12px 22px;
  border-bottom:1px solid #ece7e2;
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(12px);
  box-shadow:0 10px 28px rgba(17,17,17,.04);
}
.dp-topTitle{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}
#dp-moduleEyebrow{
  color:var(--dp-red);
  font-size:11px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}
#dp-moduleTitle{
  color:#111318;
  font-size:24px;
  line-height:1.05;
  font-weight:950;
}
.dp-topQuick{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.dp-topQuick button{
  min-height:38px;
  border:1px solid #ead7d2;
  border-radius:999px;
  background:#fff;
  color:#8f0000;
  padding:8px 12px;
  cursor:pointer;
  font-weight:900;
  box-shadow:0 5px 14px rgba(17,17,17,.04);
}
.dp-topQuick button:hover,
.dp-topQuick button.active{
  background:#c00000;
  border-color:#c00000;
  color:#fff;
}
.dp-userBadge{
  position:static;
  justify-self:end;
  min-height:42px;
  border:1px solid #e5e7eb;
  background:#fff;
  color:#111;
  border-radius:999px;
  padding:9px 14px;
  box-shadow:0 8px 20px rgba(17,17,17,.06);
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}
#content{
  flex:1;
  padding:22px;
  background:transparent;
}
.dp-nav{
  gap:6px;
  overflow:auto;
  max-height:calc(100vh - 165px);
  padding-right:2px;
}
.dp-navBtn{
  min-height:44px;
  border-radius:12px;
  background:#fff;
  color:#2b3038;
  border:1px solid #eee3df;
  box-shadow:none;
}
.dp-navBtn svg{
  stroke:currentColor;
}
.dp-navBtn:hover{
  background:#fff5f3;
  color:#990000;
  box-shadow:0 8px 18px rgba(192,0,0,.08);
}
.dp-navBtn.active{
  background:linear-gradient(135deg,#c00000,#e10000);
  color:#fff;
  border-color:#c00000;
  outline:none;
  box-shadow:0 12px 24px rgba(192,0,0,.22);
}
.dp-navBtn.active svg{
  stroke:#fff;
}
.dp-brandLogoWrap{
  border-color:#f0d8d2;
  box-shadow:0 8px 18px rgba(17,17,17,.05);
}
#dp-menuName{
  color:#15171c;
}
.dp-brandSub{
  color:#8f0000;
}
body.dp-menu-collapsed #menu{
  width:82px;
}
body.dp-menu-collapsed .dp-nav{
  max-height:calc(100vh - 128px);
}
body.dp-menu-collapsed .dp-navBtn{
  justify-content:center;
}

@media(max-width:1050px){
  .dp-appTopbar{
    grid-template-columns:1fr auto;
  }
  .dp-topQuick{
    grid-column:1 / -1;
    justify-content:flex-start;
    order:3;
  }
}
@media(max-width:760px){
  #app{
    flex-direction:column;
  }
  #menu{
    position:sticky;
    top:0;
    z-index:60;
    width:100%;
    height:auto;
    padding:10px;
    border-right:none;
    border-bottom:1px solid #eadfda;
  }
  .dp-menuTop{
    flex-direction:row;
    align-items:center;
    padding-bottom:8px;
  }
  .dp-brand{
    flex-direction:row;
    justify-content:flex-start;
    text-align:left;
  }
  .dp-brandLogoWrap{
    width:46px;
    height:46px;
    flex-basis:46px;
  }
  #dp-menuName,
  .dp-brandSub{
    text-align:left;
  }
  .dp-nav{
    flex-direction:row;
    max-height:none;
    overflow-x:auto;
    padding-bottom:4px;
  }
  .dp-navBtn{
    width:auto;
    min-width:54px;
    flex:0 0 auto;
  }
  .dp-navLbl{
    display:none;
  }
  body.dp-menu-collapsed #menu{
    width:100%;
  }
  body.dp-menu-collapsed .dp-brandText{
    display:block;
  }
  .dp-appTopbar{
    position:static;
    grid-template-columns:1fr;
    padding:12px 14px;
    gap:10px;
  }
  .dp-userBadge{
    justify-self:stretch;
    text-align:center;
  }
  .dp-topQuick{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  #content{
    padding:14px;
  }
}

/* V30.6 - se retira la franja superior fija para liberar vista */
.dp-appTopbar{
  position:static;
  min-height:0;
  padding:0;
  margin:0;
  border:0;
  background:transparent;
  box-shadow:none;
  display:block;
}
.dp-appTopbar .dp-topTitle,
.dp-appTopbar .dp-topQuick{
  display:none !important;
}
.dp-appTopbar .dp-userBadge{
  position:fixed;
  top:14px;
  right:18px;
  z-index:140;
}
