:root{
  --blue:#0b5ed7;
  --blue2:#1f8cff;
  --bg:#f3f7ff;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#5a6b85;
  --line: rgba(15, 46, 110, .10);
  --shadow: 0 10px 22px rgba(14, 35, 76, .14);
  --radius: 18px;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial;
  background: linear-gradient(180deg, #eaf2ff 0%, var(--bg) 40%, #ffffff 100%);
  color: var(--text);
}
a{color:inherit; text-decoration:none}
.phone{
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 14px calc(12px + env(safe-area-inset-top));
  background: linear-gradient(90deg, var(--blue), var(--blue2));
  color: #fff;
  box-shadow: 0 8px 18px rgba(5, 56, 140, .22);
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
}
.title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.title h1{
  margin:0;
  font-size: 16px;
  letter-spacing: .2px;
  font-weight: 850;
  line-height: 1.1;
}
.title .sub{
  margin-top:4px;
  font-size: 12px;
  opacity: .92;
}
.chipbtn{
  appearance:none;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.18);
  color:#fff;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor:pointer;
  backdrop-filter: blur(10px);
}
.chipbtn:active{transform: translateY(1px)}
.content{
  padding: 14px;
  display: grid;
  gap: 12px;
}
.card{
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  border: 1px solid rgba(15, 46, 110, .06);
}
.card h2{margin:0 0 6px 0; font-size: 14px;}
.card p{margin:0; font-size: 12px; color: var(--muted);}
.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.tile{
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 10px 18px rgba(16, 37, 86, .10);
  overflow:hidden;
  border: 1px solid rgba(22, 53, 120, .08);
  display:flex;
  flex-direction:column;
  align-items:stretch;
  cursor:pointer;
  user-select:none;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  outline:none;
}
.tile img{ width: 100%; height:auto; display:block; }

/* hover highlight (desktop) */
.tile:hover{
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 26px rgba(16, 37, 86, .16);
  border-color: rgba(11,94,215,.35);
}

/* focus highlight (keyboard) */
.tile:focus-visible{
  box-shadow: 0 16px 26px rgba(16, 37, 86, .18);
  border-color: rgba(11,94,215,.45);
}

/* tap feedback (mobile) */
.tile:active{ transform: translateY(1px); }

.hint{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(11, 94, 215, .06);
  border: 1px dashed rgba(11, 94, 215, .25);
  padding: 10px 12px;
  border-radius: 14px;
}
.row{display:flex; gap:10px; align-items:center}
.row.between{justify-content:space-between}
.field{display:grid; gap:6px; margin-bottom: 10px;}
label{font-size:12px; color: var(--muted);}
input, select, textarea{
  width:100%;
  border:1px solid var(--line);
  background: rgba(255,255,255,.7);
  color: var(--text);
  padding: 12px 12px;
  border-radius: 14px;
  outline:none;
}
textarea{min-height: 92px; resize: vertical;}
.btn{
  width:100%;
  border: 1px solid rgba(255,255,255,.0);
  background: rgba(11, 94, 215, .10);
  color: var(--blue);
  padding: 12px 12px;
  border-radius: 14px;
  font-weight:750;
  display:flex; align-items:center; justify-content:center; gap:8px;
  cursor:pointer;
}
.btn.primary{
  color:#fff;
  background: linear-gradient(90deg, var(--blue), var(--blue2));
}
.btn:active{transform: translateY(1px)}
.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
  border:1px solid var(--line);
  margin-top: 10px;
}
.table th, .table td{
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  font-size: 12px;
  text-align:left;
}
.table th{color: var(--muted); font-weight:800; background: rgba(234, 242, 255, .8)}
.table tr:last-child td{border-bottom:none}
.badge{
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.6);
  color: var(--muted);
  white-space:nowrap;
}
.badge.good{border-color: rgba(34,197,94,.30); background: rgba(34,197,94,.10); color: #065f46}
.badge.warn{border-color: rgba(245,158,11,.30); background: rgba(245,158,11,.10); color: #92400e}
.badge.bad{border-color: rgba(244,63,94,.30); background: rgba(244,63,94,.10); color: #9f1239}

/* Bottom nav (rendered by JS) */
.tabs{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(430px, 100%);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs .wrap{
  display:grid;
  grid-template-columns: repeat(var(--nav-cols, 4), 1fr);
  gap: 8px;
}
.tab{
  border: 1px solid var(--line);
  background: rgba(234,242,255,.55);
  border-radius: 16px;
  padding: 10px 8px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  font-size: 11px;
  color: var(--muted);
}
.tab.active{
  color: var(--blue);
  border-color: rgba(11,94,215,.35);
  background: rgba(11,94,215,.10);
}
.tab svg{opacity:.9}
.small{font-size:11px; color: var(--muted);}
.kbd{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New"; font-size: 11px;}

/* se agrega muestar para ver en desktop */
@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .content {
    padding: 24px;
  }
}

@media (min-width: 1024px) {

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

  .sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid #ddd;
    padding: 16px;
  }

  .sidebar h2 {
    font-size: 18px;
    margin-bottom: 16px;
  }

  .sidebar nav a {
    display: block;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    margin-bottom: 6px;
  }

  .sidebar nav a:hover {
    background: #f2ede7;
  }

  .phone {
    max-width: none;
    flex: 1;
  }

  .grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,.08);
  }

  #bottomNav {
    display: none;
  }
}

/* agregado para listar_ingredientes_3.php*/
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.card-head h2 {
  font-size: 16px;
  margin: 0;
}

.card-body.hidden {
  display: none;
}

/* tabla consistente con el panel */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 8px 6px;
  border-bottom: 1px solid #eee;
  text-align: left;
}

@media (min-width: 1024px) {
  .phone {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* se agregan nuevos cambios*/
/* ===== Ingredientes: header de categorÃ­a ===== */
.cat-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  cursor:pointer;
  padding:10px 12px;
  border-radius:12px;
  background: rgba(0,0,0,.03);
}

.cat-title{
  font-weight:700;
  font-size:14px;
}

/* body oculto por defecto (equivalente a d-none) */
.is-hidden{ display:none; }

/* separacion */
.cat-body{ margin-top:10px; }

/* ===== Layout desktop con sidebar (si ya lo tienes, puedes omitir) ===== */
@media (min-width: 1024px) {
  .app-shell{
    display:flex;
    min-height:100vh;
  }

  .sidebar{
    display:block;
    width:220px;
    background:#fff;
    border-right:1px solid #ddd;
    padding:16px;
  }

  .sidebar nav a{
    display:block;
    padding:10px;
    border-radius:10px;
    text-decoration:none;
    color:#333;
    margin-bottom:6px;
  }
  .sidebar nav a:hover{ background: rgba(0,0,0,.05); }

  /* Mantener el ancho maestro igual al home */
  .phone{
    max-width:1200px;
    margin:0 auto;
    flex:1;
  }

  /* opcional: ocultar bottomNav en desktop */
  #bottomNav{ display:none; }
}

/* Se agrega esta linea para index, para agregar el boton de configuracion a la pagian principal */
/* ConfiguraciÃ³n visible solo en desktop */
.config-btn {
  display: none;
}

@media (min-width: 1024px) {
  .config-btn {
    display: inline-flex;
  }
}


/* Bot¨®n submit visible en formularios */
.card form .chipbtn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  margin-top: 12px;
}


/* ===========================
   BOTONES EN FORMULARIOS
   =========================== */

.chipbtn-form {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 44px;

  padding: 12px 16px;
  margin-top: 14px;

  font-size: 14px;
  font-weight: 600;

  border-radius: 14px;
  border: none;
  cursor: pointer;

  background: var(--btn-bg, #2f2f2f);
  color: #fff;
}

/* Asegura que <button> no herede estilos raros */
button.chipbtn-form {
  appearance: none;
  -webkit-appearance: none;
}

.card form {
  display: block;
}

.card form button {
  opacity: 1;
  visibility: visible;
}

.btn.icon {
  padding: 4px 6px;
  font-size: 14px;
  border-radius: 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  background: rgba(11, 94, 215, .06);
  border: 1px solid rgba(11, 94, 215, .12);
  color: #0b5ed7;
}
.btn.icon:hover {
  background: rgba(11, 94, 215, .15);
  border-color: rgba(11, 94, 215, .3);
}
  


