:root{
  --bg:#0b0f14;
  --panel:#111827;
  --panel2:#0f172a;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --border:#1f2937;
  --accent:#60a5fa;
  --accent2:#34d399;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: "Cascadia Code", "Consolas", "Lucida Console", "Courier New", monospace;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 0 4px rgba(96,165,250,.35);
  background: radial-gradient(1200px 800px at 10% 10%, #0f172a, var(--bg));
  color:var(--text);
}

/* ============================= */
/* MOBILE FIRST */
/* ============================= */

.app{
  display:flex;
  flex-direction:column;
  min-height:100vh;
}

/* Sidebar como drawer en mobile */
.sidebar{
  position:fixed;
  left:-100%;
  top:0;
  width:260px;
  height:100%;
  padding:18px;
  border-right:1px solid var(--border);
  background: linear-gradient(180deg, rgba(17,24,39,.95), rgba(11,15,20,.95));
  transition:left .3s ease;
  z-index:1000;
}

.sidebar.open{
  left:0;
}

.brand{
  font-weight:800;
  font-size:18px;
  letter-spacing:.2px;
  margin-bottom:14px;
}

.tab{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px;
  margin:8px 0;
  border:1px solid var(--border);
  background: rgba(15,23,42,.6);
  color:var(--text);
  border-radius:12px;
  cursor:pointer;
  transition: transform .06s ease, border-color .15s ease;
}

.tab:hover{ transform: translateY(-1px); border-color:#334155; }
.tab.active{ border-color: var(--accent); box-shadow: 0 0 0 3px rgba(96,165,250,.12); }

.ico{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background: rgba(96,165,250,.12);
  border:1px solid rgba(96,165,250,.2);
  font-weight:700;
}

.hint{
  margin-top:18px;
  padding:12px;
  border:1px dashed #334155;
  border-radius:12px;
  color:var(--muted);
  background: rgba(15,23,42,.35);
}

/* Tips Accordion */
.tips-toggle{
  width:100%;
  padding:8px;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.55);
  color:var(--text);
  cursor:pointer;
  margin-bottom:8px;
}

.tips-content.hidden{
  display:none;
}

.hint ul{ margin:0; padding-left:18px; }
.hint li{ margin:6px 0; }
.hint code{ color:#c7d2fe; }

/* Main */

.main{
  padding:16px;
}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}

.header h1{
  margin:0;
  font-size:clamp(22px, 4vw, 28px);
}

.status{
  color:var(--muted);
  font-size:10px;
}

.panel{
  border:1px solid var(--border);
  background: rgba(17,24,39,.65);
  border-radius:16px;
  padding:16px;
  max-width:100%;
}

.hidden{ display:none !important; }

.label{
  display:block;
  color:var(--muted);
  font-size:13px;
  margin:6px 0 8px;
}

.input{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.55);
  color:var(--text);
  outline:none;
}
.input:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96,165,250,.12);
}

.help-text{
  margin:8px 0 0;
  color:var(--muted);
  font-size:10px;
  letter-spacing:0.2px;
}

.help-text strong{
  color:#c7d2fe;
}

.row{
  display:flex;
  gap:10px;
  margin-top:12px;
  flex-wrap:wrap;
}

.btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.55);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{ border-color:#334155; }
.btn.primary{
  border-color: rgba(96,165,250,.55);
  background: rgba(96,165,250,.16);
}

.btn:disabled{
  cursor:not-allowed;
  opacity:.65;
}

.result{
  margin-top:14px;
  padding:12px;
  border-radius:12px;
  background: rgba(15,23,42,.35);
  border:1px solid var(--border);
  min-height:44px;
  display:flex;
  align-items:center;
  overflow:auto;
}

.grid2{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

.sep{
  border:0;
  border-top:1px solid var(--border);
  margin:14px 0;
}

.chart-wrap{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  background: rgba(15,23,42,.35);
  min-height:320px;
}

.chart-wrap canvas{
  width:100% !important;
  height:300px !important;
}

/* Botón menú */
.menu-toggle{
  display:block;
  padding:8px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.55);
  color:var(--text);
  cursor:pointer;
}

/* MEDIA QUERY*/
/* ============================= */
/* CELULARES ≥ 600px */
/* ============================= */

@media (min-width:600px){

  .grid2{
    grid-template-columns:1fr 1fr;
  }

}

/* ============================= */
/* TABLET ≥ 768px */
/* ============================= */

@media (min-width:768px){

  .grid2{
    grid-template-columns:1fr 1fr;
  }

}

/* ============================= */
/* DESKTOP ≥ 1024px */
/* ============================= */

@media (min-width:1024px){

  .app{
    display:grid;
    grid-template-columns:280px 1fr;
  }

  .sidebar{
    position:relative;
    left:0;
    height:auto;
  }

  .menu-toggle{
    display:none;
  }

}

/* ============================= */
/* DESKTOP GRANDE ≥ 1440px */
/* ============================= */

@media (min-width:1440px){

  .main{
    padding:32px 64px;
  }

}

.tip-text{
  min-height:60px;
  display:flex;
  align-items:center;
  padding:8px;
  border-radius:8px;
  background: rgba(15,23,42,.4);
  border:1px solid var(--border);
  font-size:7px;
}

/* ===== Fix iOS date input overflow ===== */

input[type="date"]{
  appearance: none;
  -webkit-appearance: none;
  position: relative;
}

/* elimina bordes internos raros */
input[type="date"]::-webkit-datetime-edit{
  color: var(--text);
}

input[type="date"]::-webkit-calendar-picker-indicator{
  filter: invert(1);
  opacity: 0.8;
}

/* evita que sobresalga */
input[type="date"]{
  overflow: hidden;
}


.app-footer{
  margin-top:20px;
  padding:14px 10px 2px;
  text-align:center;
  color:var(--muted);
  font-size:10px;
  letter-spacing:0.3px;
}

.text-cyber-gold{
  color:#facc15;
  font-weight:700;
}
