/* Layout novo: shell lateral + bento (página inicial /) */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --shell-bg: #f4f2ef;
  --rail-bg: #1c1917;
  --rail-text: #e7e5e4;
  --rail-muted: #a8a29e;
  --rail-hover: #292524;
  --card: #ffffff;
  --card-border: #d6d3d1;
  --accent: #c2410c;
  --accent-soft: #fff7ed;
  --teal: #0f766e;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #d6d3d1;
  --danger: #b91c1c;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--shell-bg);
  color: var(--ink);
}

/* Shell: lateral + conteúdo */
#app-home {
  display: grid;
  grid-template-columns: 15.5rem 1fr;
  min-height: 100vh;
}

@media (max-width: 880px) {
  #app-home {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}

/* —— Rail —— */
#app-home .rail {
  background: var(--rail-bg);
  color: var(--rail-text);
  padding: 1.25rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-right: 1px solid #0c0a09;
}

@media (max-width: 880px) {
  #app-home .rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: none;
    border-bottom: 3px solid var(--accent);
    padding: 0.75rem 1rem;
  }
}

#app-home .rail-logo {
  padding: 0.5rem;
  background: #fff;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}
#app-home .rail-logo img {
  display: block;
  width: 100%;
  max-width: 11rem;
  height: auto;
  margin: 0 auto;
}

@media (max-width: 880px) {
  #app-home .rail-logo {
    width: 6.5rem;
    margin: 0;
    flex-shrink: 0;
  }
  #app-home .rail-logo img { max-width: 100%; }
}

#app-home .rail-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--rail-muted);
  font-weight: 700;
  margin: 0.5rem 0 0.25rem 0.35rem;
}

@media (max-width: 880px) {
  #app-home .rail-title { display: none; }
}

#app-home .rail-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

@media (max-width: 880px) {
  #app-home .rail-nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 0.35rem;
  }
}

#app-home .rail-nav a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 0.45rem;
  color: var(--rail-text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
}
#app-home .rail-nav a:hover {
  background: var(--rail-hover);
  border-color: #44403c;
}
#app-home .rail-nav a.rail-pedidos {
  background: var(--accent-soft);
  color: #9a3412;
  border-color: #fed7aa;
}
#app-home .rail-nav a.rail-pedidos:hover {
  background: #ffedd5;
}

#app-home .rail-meta {
  font-size: 0.75rem;
  color: var(--rail-muted);
  padding: 0.5rem 0.5rem 0;
  margin-top: auto;
}

@media (max-width: 880px) {
  #app-home .rail-meta {
    width: 100%;
    order: 10;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #44403c;
  }
}

#app-home .rail-meta strong {
  color: #fef3c7;
  font-weight: 700;
}

#app-home .rail-out {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  text-align: center;
  border-radius: 0.45rem;
  border: 1px solid #57534e;
  color: #fecaca;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}
#app-home .rail-out:hover {
  background: #450a0a;
  border-color: #fca5a5;
}

@media (max-width: 880px) {
  #app-home .rail-out {
    margin-top: 0;
    width: auto;
    padding: 0.4rem 0.85rem;
  }
}

/* —— Área principal —— */
#app-home .shell {
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 2rem;
  overflow-x: auto;
}

#app-home .shell-hd {
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
#app-home .shell-hd h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
#app-home .shell-hd .greet {
  width: 100%;
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
}
#app-home .shell-hd .greet .line-strong {
  font-weight: 700;
  color: var(--ink);
}
#app-home .idchip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: #e7e5e4;
  color: var(--ink);
  border: 1px solid var(--line);
}

/* —— Bento —— */
#app-home .bento {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

#app-home .cell {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 7.5rem;
  padding: 1.15rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid var(--card-border);
  background: var(--card);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 0 rgba(28, 25, 23, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  position: relative;
  overflow: hidden;
}
#app-home .cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(28, 25, 23, 0.1);
}

#app-home .cell .eyebrow {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
#app-home .cell h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
#app-home .cell p {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
  max-width: 26rem;
}

#app-home .cell-hero {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: 15rem;
  background: linear-gradient(145deg, #134e4a 0%, #0f766e 40%, #ccfbf1 100%);
  border: none;
  color: #042f2e;
  justify-content: flex-end;
}
#app-home .cell-hero .eyebrow { color: rgba(4, 47, 46, 0.65); }
#app-home .cell-hero h2 { font-size: 1.45rem; color: #022c22; }
#app-home .cell-hero p { color: #115e59; }

#app-home .cell-mesa { grid-column: 2; grid-row: 1; border-left: 4px solid #6366f1; }
#app-home .cell-com { grid-column: 3; grid-row: 1; border-left: 4px solid #0d9488; }
#app-home .cell-pend { grid-column: 2; grid-row: 2; border-left: 4px solid #ea580c; }
#app-home .cell-mov { grid-column: 3; grid-row: 2; border-left: 4px solid #78716c; }
#app-home .cell-cfg { grid-column: 2 / span 2; grid-row: 3; border-left: 4px solid #a16207; min-height: auto; }

@media (max-width: 880px) {
  #app-home .bento {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  #app-home .cell-hero,
  #app-home .cell-mesa,
  #app-home .cell-com,
  #app-home .cell-pend,
  #app-home .cell-mov,
  #app-home .cell-cfg {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 6.5rem;
  }
  #app-home .cell-hero { min-height: 11rem; }
}

/* —— Faixa contato —— */
#app-home .strip-contact {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.5rem;
  align-items: start;
  padding: 1.1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
#app-home .strip-contact .mark {
  width: 4.5rem;
  height: auto;
  display: block;
}
#app-home .strip-contact a.site {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}
#app-home .strip-contact a.site:hover { text-decoration: underline; }
#app-home .strip-contact .line-strong {
  font-weight: 700;
  color: var(--ink);
}
#app-home .strip-contact .alerta {
  color: var(--danger);
  font-weight: 700;
  margin: 0.5rem 0 0;
}

@media (max-width: 520px) {
  #app-home .strip-contact {
    grid-template-columns: 1fr;
  }
}

/* Modal (IDs para JS) */
#modalFormaPagamento {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(12, 10, 9, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#modalFormaPagamento .pg-modal-card {
  width: 100%;
  max-width: 32rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  padding: 1.35rem 1.5rem;
}
#modalFormaPagamento .pg-modal-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 800;
}
#modalFormaPagamento .pg-modal-card .hint {
  font-size: 0.82rem;
  color: #57534e;
  margin: 0 0 1rem;
}
#modalFormaPagamento .pg-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
#modalFormaPagamento #inputFormaPagamento {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
#modalFormaPagamento .pg-btn-add {
  padding: 0.55rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: var(--teal);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}
#modalFormaPagamento .pg-btn-add:hover { filter: brightness(0.95); }
#modalFormaPagamento .pg-lista-wrap {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fafaf9;
  min-height: 4rem;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.5rem;
}
#modalFormaPagamento .pg-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}
#modalFormaPagamento .pg-btn-fech {
  padding: 0.45rem 1rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0.5rem;
  cursor: pointer;
}
#modalFormaPagamento .pg-placeholder {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: #78716c;
}
