/* ===========================================
   GestorOS - Design System
   Palette: Professional Blue #1B3A5F / Energetic Orange #FF8C00
   =========================================== */
:root {
  --primary: #1B3A5F;
  --primary-dark: #12263F;
  --primary-light: #E2E8F0;
  --secondary: #FF8C00;
  --secondary-dark: #CC7000;
  --secondary-light: #FFF4E5;
  --success: #2ECC71;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --text: #2D3E50;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
  background: var(--bg); 
  color: var(--text); 
  display: flex; 
  flex-direction: column; 
}

h1, h2, h3, h4, .hlogo, .mtitle, .bsec, .tlbl, .catnav button {
  font-family: 'Outfit', sans-serif;
}

.iprice, .tnum, .orsub, .kval, .pq, .ps {
  font-family: 'JetBrains Mono', monospace;
}

/* -- HEADER -- */
header { 
  background: var(--primary); 
  color: var(--surface); 
  height: 60px; 
  padding: 0 1.5rem; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  flex-shrink: 0; 
  border-bottom: 4px solid var(--secondary); 
  z-index: 300;
  box-shadow: var(--shadow-md);
}
.hlogo { 
  font-size: 1.4rem; 
  font-weight: 800; 
  text-transform: uppercase; 
  letter-spacing: .02em; 
}
.hlogo span { color: var(--secondary); }
.hdate { font-size: .75rem; color: rgba(255,255,255,0.6); }

.htabs { 
  display: flex; 
  gap: .5rem; 
  overflow-x: auto; 
  scrollbar-width: none; 
  -webkit-overflow-scrolling: touch; 
}
.htabs::-webkit-scrollbar { display: none; }
.tbtn { 
  flex-shrink: 0; 
  white-space: nowrap; 
  font-size: .8rem; 
  font-weight: 700; 
  text-transform: uppercase; 
  background: rgba(255,255,255,0.1); 
  border: 1px solid rgba(255,255,255,0.2); 
  color: rgba(255,255,255,0.8); 
  padding: .5rem 1rem; 
  border-radius: 8px; 
  cursor: pointer; 
  transition: all .2s; 
  min-height: 40px; 
}
.tbtn:hover { 
  background: rgba(255,255,255,0.2); 
  color: var(--surface); 
}
.tbtn.active { 
  background: var(--secondary); 
  border-color: var(--secondary); 
  color: var(--surface); 
  box-shadow: 0 4px 12px rgba(255,140,0,0.3);
}

/* -- LAYOUT -- */
.appbody { display: flex; flex: 1; overflow: hidden; }
.view { display: none; width: 100%; overflow: hidden; }
.view.active { display: flex; }
#vp { flex-direction: row; }
#vh, #vr, #vu, #vg, #vb, #vc { flex-direction: column; overflow-y: auto; padding: 1.5rem; gap: 1rem; }

/* -- SIDEBAR - MESAS -- */
.smesas { 
  width: 240px; 
  flex-shrink: 0; 
  background: var(--primary-dark); 
  display: flex; 
  flex-direction: column; 
  border-right: 1px solid rgba(255,255,255,0.05); 
}
.smhdr { 
  padding: 1rem 1.25rem; 
  font-family: 'Outfit', sans-serif; 
  font-size: .7rem; 
  font-weight: 700; 
  letter-spacing: .12em; 
  text-transform: uppercase; 
  color: rgba(255,255,255,0.4); 
  border-bottom: 1px solid rgba(255,255,255,0.05); 
}
.smlist { flex: 1; overflow-y: auto; padding: .75rem; }

.mitem { 
  padding: .85rem 1rem; 
  border-radius: 12px; 
  cursor: pointer; 
  margin-bottom: .5rem; 
  border: 1px solid transparent; 
  transition: all .2s; 
  position: relative; 
  min-height: 60px; 
  display: flex; 
  flex-direction: column; 
  justify-content: center;
  background: rgba(255,255,255,0.03);
}
.mitem:hover { background: rgba(255,255,255,0.08); }
.mitem.active { 
  background: var(--secondary); 
  border-color: var(--secondary); 
  box-shadow: 0 4px 12px rgba(255,140,0,0.2);
}
.mnum { 
  font-family: 'Outfit', sans-serif; 
  font-size: 1.05rem; 
  font-weight: 700; 
  color: var(--surface); 
}
.mcli { font-size: .75rem; color: rgba(255,255,255,0.5); margin-top: 2px; }
.mtotal { 
  font-family: 'JetBrains Mono', monospace; 
  font-size: .85rem; 
  font-weight: 600; 
  color: rgba(255,255,255,0.9); 
  margin-top: 4px; 
}
.mx { 
  position: absolute; top: 10px; right: 10px; 
  background: rgba(255,255,255,0.1); 
  border: none; color: rgba(255,255,255,0.4); 
  font-size: .75rem; cursor: pointer; 
  width: 24px; height: 24px; 
  display: flex; align-items: center; justify-content: center; 
  border-radius: 6px; 
}
.mx:hover { color: var(--surface); background: rgba(255,0,0,0.4); }

.bnm { 
  margin: .75rem; 
  padding: .85rem; 
  background: rgba(255,255,255,0.05); 
  border: 2px dashed rgba(255,255,255,0.15); 
  color: rgba(255,255,255,0.6); 
  border-radius: 12px; 
  cursor: pointer; 
  font-weight: 700; 
  text-transform: uppercase; 
  transition: all .2s; 
}
.bnm:hover { 
  background: rgba(255,255,255,0.1); 
  color: var(--surface); 
  border-color: var(--secondary); 
}

/* -- MENU -- */
.pmenu { flex: 1; overflow-y: auto; padding: 1.25rem; }
.nomesa { 
  display: flex; flex-direction: column; align-items: center; justify-content: center; 
  height: 100%; color: var(--text-muted); text-align: center; gap: 1rem; 
}

.catnav { 
  display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; 
  position: sticky; top: 0; background: var(--bg); padding: .5rem 0; z-index: 10; 
}
.cbtn { 
  font-family: 'Outfit', sans-serif; 
  font-size: .8rem; font-weight: 700; 
  text-transform: uppercase; 
  background: var(--surface); 
  border: 1px solid var(--border); 
  color: var(--text-muted); 
  padding: .5rem 1.1rem; 
  border-radius: 25px; 
  cursor: pointer; 
  transition: all .2s; 
  box-shadow: var(--shadow-sm);
}
.cbtn.active, .cbtn:hover { 
  background: var(--primary); 
  color: var(--surface); 
  border-color: var(--primary); 
  box-shadow: 0 4px 10px rgba(27,58,95,0.2);
}

.msec { margin-bottom: 1.5rem; }
.slbl { 
  display: inline-block; 
  background: var(--primary-light); 
  color: var(--primary); 
  font-family: 'Outfit', sans-serif; 
  font-size: .9rem; 
  font-weight: 800; 
  text-transform: uppercase; 
  padding: .3rem .85rem; 
  border-radius: 8px; 
  margin-bottom: .75rem; 
}

.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.icard { 
  background: var(--surface); 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 1rem; 
  display: flex; justify-content: space-between; align-items: center; gap: .75rem; 
  cursor: pointer; transition: all .2s; 
  box-shadow: var(--shadow-sm);
}
.icard:hover { 
  border-color: var(--primary); 
  box-shadow: var(--shadow-md); 
  transform: translateY(-2px); 
}
.icard:active { transform: scale(.97); }
.iname { font-weight: 600; font-size: .95rem; line-height: 1.2; flex: 1; color: var(--text); }
.iprice { font-weight: 700; font-size: 1rem; color: var(--primary); }
.iadd { 
  width: 28px; height: 28px; border-radius: 50%; 
  background: var(--secondary); color: var(--surface); 
  border: none; font-size: 1rem; display: flex; align-items: center; justify-content: center; 
  flex-shrink: 0; box-shadow: 0 2px 5px rgba(255,140,0,0.3);
}

/* -- ORDER -- */
.porden { 
  width: 320px; 
  flex-shrink: 0; 
  background: var(--surface); 
  border-left: 1px solid var(--border); 
  display: flex; 
  flex-direction: column; 
  box-shadow: -4px 0 15px rgba(0,0,0,0.03);
}
.otop { background: var(--primary); color: var(--surface); padding: 1.25rem 1rem; flex-shrink: 0; }
.omlbl { 
  font-family: 'Outfit', sans-serif; 
  font-size: .95rem; font-weight: 800; 
  text-transform: uppercase; 
  margin-bottom: .75rem; 
}
.icli { 
  width: 100%; 
  padding: .6rem .85rem; 
  border: 1px solid rgba(255,255,255,0.2); 
  border-radius: 8px; 
  background: rgba(255,255,255,0.1); 
  color: var(--surface); 
  font-size: .9rem; 
}
.icli::placeholder { color: rgba(255,255,255,0.4); }
.icli:focus { outline: none; border-color: var(--secondary); background: rgba(255,255,255,0.15); }

.olist { flex: 1; overflow-y: auto; padding: .5rem; }
.oempty { text-align: center; color: var(--text-muted); font-size: .85rem; padding: 3rem 1rem; }

.orow { 
  display: flex; align-items: center; gap: .5rem; 
  padding: .75rem .5rem; border-bottom: 1px solid var(--border); 
}
.orname { flex: 1; font-weight: 600; font-size: .9rem; color: var(--text); }
.orctrl { display: flex; align-items: center; gap: .25rem; }
.orbtn { 
  width: 30px; height: 30px; border-radius: 8px; 
  border: 1px solid var(--border); background: var(--bg); 
  cursor: pointer; font-weight: 700; transition: all .15s; 
}
.orbtn:hover { background: var(--primary); color: var(--surface); border-color: var(--primary); }
.orqty { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .95rem; min-width: 24px; text-align: center; }
.orsub { font-weight: 700; font-size: .9rem; color: var(--primary); min-width: 50px; text-align: right; }
.ordel { 
  background: none; border: none; color: #E53E3E; 
  cursor: pointer; width: 30px; height: 30px; 
  display: flex; align-items: center; justify-content: center; 
  border-radius: 6px; 
}
.ordel:hover { background: #FFF5F5; }

.ofooter { padding: 1.25rem 1rem; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--bg); }
.trow { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.tlbl { font-size: .85rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.tnum { font-size: 2rem; font-weight: 800; color: var(--primary); }
.brow { display: flex; gap: .75rem; }
.blim { 
  flex: 1; background: var(--surface); border: 1px solid var(--border); 
  color: var(--text-muted); border-radius: 10px; padding: .85rem; 
  font-weight: 700; text-transform: uppercase; cursor: pointer; transition: all .2s; 
}
.blim:hover { background: var(--border); color: var(--text); }
.bcob { 
  flex: 2; background: var(--secondary); border: none; 
  color: var(--surface); border-radius: 10px; padding: .85rem; 
  font-size: 1.05rem; font-weight: 800; text-transform: uppercase; 
  cursor: pointer; transition: all .2s; box-shadow: 0 4px 12px rgba(255,140,0,0.3);
}
.bcob:hover { background: var(--secondary-dark); transform: translateY(-1px); }
.bcob:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; box-shadow: none; transform: none; }

/* -- MODALS -- */
.moverlay { 
  display: none; position: fixed; inset: 0; 
  background: rgba(18, 38, 63, 0.7); 
  backdrop-filter: blur(4px); 
  z-index: 500; align-items: center; justify-content: center; 
}
.moverlay.open { display: flex; }
.modal, .notasModal { 
  background: var(--surface); border-radius: 20px; padding: 2rem; 
  max-width: 400px; width: 92%; box-shadow: var(--shadow-lg); 
}
.mtitle { font-size: 1.25rem; font-weight: 800; text-transform: uppercase; color: var(--primary); margin-bottom: .5rem; }
.mbody { font-size: .9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; }
.mtotal { font-family: 'JetBrains Mono', monospace; font-size: 2.2rem; font-weight: 800; color: var(--secondary); margin: .5rem 0; }

.mbtns { display: flex; gap: .75rem; }
.mcan { 
  flex: 1; background: var(--bg); border: 1px solid var(--border); 
  color: var(--text-muted); border-radius: 10px; padding: .85rem; 
  font-weight: 700; text-transform: uppercase; cursor: pointer; 
}
.mcon { 
  flex: 2; background: var(--secondary); border: none; 
  color: var(--surface); border-radius: 10px; padding: .85rem; 
  font-weight: 800; text-transform: uppercase; cursor: pointer; 
  box-shadow: 0 4px 12px rgba(255,140,0,0.25);
}

/* -- TOAST -- */
.toast { 
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(100px); 
  background: var(--primary); color: var(--surface); 
  font-family: 'Outfit', sans-serif; font-size: .9rem; font-weight: 700; 
  padding: .75rem 1.75rem; border-radius: 30px; 
  z-index: 600; transition: transform .3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
  box-shadow: var(--shadow-lg); border: 2px solid var(--secondary);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* -- LOGIN -- */
#loginScreen { background: var(--primary); padding: 1.5rem; display: flex; align-items: center; justify-content: center; position: fixed; inset: 0; z-index: 1000; }
.loginBox { 
  background: var(--surface); border-radius: 20px; padding: 2.5rem 2rem; 
  max-width: 400px; width: 100%; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); 
}
.loginTitle { font-size: 1.3rem; color: var(--primary); margin-bottom: 1rem; text-align: center; font-weight: 800; text-transform: uppercase; }
.loginBtn { 
  background: var(--secondary); border: none; color: var(--surface); border-radius: 10px; 
  font-size: 1.1rem; font-weight: 800; padding: 1rem; width: 100%; cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(255,140,0,0.3);
}

.mob-nav { display: none; }
.mob-visible { display: flex; }
.mob-hide { display: none !important; }

/* -- RESPONSIVE -- */
@media(max-width:767px) {
  header { padding: 0 1rem; height: 56px; }
  .hlogo { font-size: 1.1rem; }
  .smesas { width: 100%; display: none; }
  .smesas.mob-active { display: flex; }
  .pmenu { display: none; padding: 1rem; }
  .pmenu.mob-active { display: block; }
  .porden { width: 100%; display: none; border-left: none; }
  .porden.mob-active { display: flex; }
  
  .mob-nav { 
    display: none; position: fixed; bottom: 0; left: 0; right: 0; 
    background: var(--primary); border-top: 3px solid var(--secondary); 
    z-index: 400; padding-bottom: env(safe-area-inset-bottom, 0px); 
  }
  .mob-nav.mob-visible { display: flex; }
  .mob-nav-inner { display: flex; width: 100%; height: 65px; }
  .mob-nav button { 
    flex: 1; background: none; border: none; 
    color: rgba(255,255,255,0.5); font-family: 'Outfit', sans-serif; 
    font-size: .7rem; font-weight: 700; text-transform: uppercase; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    position: relative;
  }
  .mob-nav button.active { color: var(--surface); }
  .mob-nav button.active::after { content: ''; position: absolute; top: 0; width: 30px; height: 3px; background: var(--secondary); }
}
