/* digitalizateia.lat - panel de plataforma */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e4e7ec;
  --text: #101828;
  --muted: #667085;
  --brand: #2563eb;
  --brand-2: #60a5fa;
  --ok: #12b76a;
  --warn: #f79009;
  --bad: #f04438;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body.plat {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
h1 { font-size: 1.6rem; margin: 0 0 .2rem; letter-spacing: -.02em; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
code { background: #f2f4f7; padding: .1rem .35rem; border-radius: 6px; font-size: .88em; }
.muted { color: var(--muted); }
.centro { text-align: center; }
.enlace { color: var(--brand); }
.enlace:hover { text-decoration: underline; }

/* cabecera */
.top {
  display: flex; align-items: center; gap: 1.2rem;
  padding: .8rem 1.4rem; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; }
.brand--centro { justify-content: center; margin-bottom: 1rem; }
.brand__mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #ffffff; font-weight: 900;
}
img.brand__mark { background: transparent; object-fit: contain; }
.brand__name span { color: var(--muted); font-weight: 500; }
.brand__tag { font-style: normal; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--brand); background: rgba(37,99,235,.12); padding: .15rem .5rem; border-radius: 999px; }
.top__nav { display: flex; gap: 1.2rem; margin-left: auto; }
.top__nav a { color: var(--muted); font-size: .95rem; }
.top__nav a:hover { color: var(--text); }
.top__salir { display: flex; align-items: center; gap: .7rem; }

/* botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .92rem; transition: transform .15s, background .2s, box-shadow .2s;
}
.btn--primary { background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #ffffff; box-shadow: 0 8px 20px rgba(37,99,235,.28); }
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn--ghost:hover { background: #f2f4f7; }
.btn--google { background: #ffffff; border-color: #dadce0; color: #3c4043; font-weight: 500; }
.btn--google:hover { background: #f8f9fa; border-color: #dadce0; color: #202124; }
.btn__icon { width: 1.15em; height: 1.15em; flex: none; }
.btn--sm { padding: .4rem .75rem; font-size: .85rem; }
.btn--block { width: 100%; }
.btn--peligro { background: var(--bad); border-color: var(--bad); color: #ffffff; }
.btn--peligro:hover { background: #d92d20; border-color: #d92d20; }
.carta--peligro { border-color: #fda29b; background: #fffbfa; }

/* contenido */
.contenido { max-width: 1040px; margin: 0 auto; padding: 1.8rem 1.4rem 3rem; }
.contenido--angosto { max-width: 720px; }
.titulo { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }

/* tarjetas y metricas */
.metricas { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-bottom: 1.6rem; }
.metrica { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.metrica span { display: block; color: var(--muted); font-size: .85rem; }
.metrica strong { font-size: 1.7rem; letter-spacing: -.02em; }

.bloque { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.bloque__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.bloque__head h2 { margin: 0; }

.carta { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.carta h2 { margin-top: 1.2rem; }
.carta h2:first-child { margin-top: 0; }
.carta--form { display: grid; gap: .9rem; }
.carta--form label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 600; }
.carta--form input, .carta--form select {
  width: 100%; padding: .7rem .85rem; border-radius: 10px; border: 1px solid var(--line);
  font: inherit; font-weight: 400; background: #fff;
}
.carta--form input:focus, .carta--form select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.16); }
.carta--form small { font-weight: 400; }
.rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }

.datos { display: grid; gap: .6rem; }
.datos > div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.datos > div:last-child { border-bottom: 0; }
.datos span { color: var(--muted); }
.datos strong { text-align: right; word-break: break-word; }

.acciones { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.1rem; }

/* acciones dentro de una celda de tabla */
.fila-acciones { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.fila-acciones form { margin: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* tabla */
.tabla-envoltura { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tabla th, .tabla td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabla th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.tabla tr:last-child td { border-bottom: 0; }

/* estados */
.estado { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.estado--activo { background: rgba(18,183,106,.14); color: #067647; }
.estado--prueba { background: rgba(247,144,9,.16); color: #b54708; }
.estado--suspendido { background: rgba(240,68,56,.14); color: #b42318; }

/* avisos y flash */
.aviso { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem; }
.aviso ul { margin: 0; padding-left: 1.1rem; }
.aviso--error { background: #fef3f2; border: 1px solid #fecdca; color: #b42318; }
.flash { max-width: 1040px; margin: 1rem auto 0; padding: .7rem 1rem; border-radius: 10px; font-size: .92rem; }
.flash--success { background: #ecfdf3; border: 1px solid #a6f4c5; color: #067647; }
.flash--error { background: #fef3f2; border: 1px solid #fecdca; color: #b42318; }
.flash--warning { background: #fffaeb; border: 1px solid #fedf89; color: #b54708; }
.vacio { color: var(--muted); padding: 1.5rem; text-align: center; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }

/* acceso */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.2rem; }
.acceso .carta { width: 100%; max-width: 380px; display: grid; gap: .9rem; }
.acceso h1 { font-size: 1.3rem; text-align: center; margin: 0; }
.acceso label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 600; }
.acceso input { width: 100%; padding: .75rem .85rem; border-radius: 10px; border: 1px solid var(--line); font: inherit; }
.acceso input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.16); }
.pie-carta { margin: .3rem 0 0; font-size: .9rem; }

.pie { text-align: center; padding: 2rem 1rem 3rem; font-size: .85rem; }

/* filas del menu */
.fila-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.fila-form input[type="text"] { padding: .5rem .6rem; border-radius: 8px; border: 1px solid var(--line); font: inherit; }
.check { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); font-weight: 500; }
.fila-platillo {
  display: grid; grid-template-columns: 84px 2fr .8fr 1.3fr 1.6fr auto auto; gap: .5rem; align-items: center;
  padding: .5rem 0; border-top: 1px dashed var(--line);
}
.fila-platillo input, .fila-platillo select {
  padding: .45rem .55rem; border-radius: 8px; border: 1px solid var(--line); font: inherit; width: 100%;
}
.fila-platillo--nuevo { border-top: 1px solid var(--line); margin-top: .5rem; }
.fila-platillo__acciones { display: flex; gap: .35rem; justify-content: flex-end; }

/* imagen de categoria / platillo */
.pimg { display: grid; gap: .25rem; justify-items: center; }
.pimg--cat { margin-right: .35rem; }
.pimg__btn {
  width: 46px; height: 46px; border-radius: 10px; border: 1px dashed var(--line);
  display: grid; place-items: center; cursor: pointer; overflow: hidden; background: #fff;
}
.pimg__btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pimg__btn span { font-size: .68rem; color: var(--muted); line-height: 1.1; text-align: center; }
.pimg__quitar { font-size: .68rem; }
.campo-imagen { display: grid; gap: .35rem; font-weight: 600; font-size: .9rem; margin-top: .6rem; }
.campo-imagen input[type="file"] { font: inherit; font-weight: 400; }

@media (max-width: 900px) {
  .fila-platillo { grid-template-columns: 1fr 1fr; }
  .fila-platillo__acciones { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .metricas { grid-template-columns: repeat(2, 1fr); }
  .rejilla { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; }
  .top__nav { order: 3; width: 100%; margin-left: 0; }
}

/* Semaforo de facturacion de la plataforma (docs/41). */
.cfdi-mini { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .9rem; }
.cfdi-mini__item {
  border-radius: 999px;
  padding: .22rem .7rem;
  font-size: .78rem;
  font-weight: 700;
  background: rgba(217, 45, 32, .12);
  color: #b42318;
}
.cfdi-mini__item.is-ok { background: rgba(18, 183, 106, .14); color: #067647; }

/* Checklist fiscal: checkbox compacto y texto legible. */
.carta--form fieldset label {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  font-weight: 500;
  font-size: .85rem;
  margin: .25rem 0;
}
.carta--form fieldset input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 2px;
}
