/* ==============================================
   CARDÁPIO — EREMPAF
   Mesma base visual do site institucional
   ============================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --azul:        #1a3c8f;
  --azul-escuro: #122d6e;
  --azul-nav:    #1e2d6f;
  --vermelho:    #c0392b;
  --amarelo:     #f0c030;
  --verde:       #27ae60;
  --cinza-bg:    #f4f6f9;
  --texto:       #1a1a2e;
  --branco:      #ffffff;
  --font-main:   'Montserrat', sans-serif;
  --font-body:   'Open Sans', sans-serif;
  --radius:      8px;
  --shadow:      0 4px 20px rgba(0,0,0,0.10);
}

body {
  font-family: var(--font-body);
  background: var(--cinza-bg);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER (idêntico ao site) ── */
.header { background: var(--azul); padding: 18px 0; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.header-brand { display: flex; align-items: center; gap: 20px; }
.header-logo  { width: 80px; height: 80px; object-fit: contain; flex-shrink: 0; }
.header-text  { display: flex; flex-direction: column; gap: 6px; }
.header-title {
  font-family: var(--font-main);
  font-size: 20px; font-weight: 800;
  color: var(--branco); line-height: 1.3;
}
.header-bar {
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--verde) 33%, var(--amarelo) 33% 66%, var(--vermelho) 66%);
  border-radius: 2px;
}
.header-slogan { font-size: 13px; color: var(--amarelo); font-weight: 600; font-style: italic; }

/* ── NAV ── */
.nav { background: var(--azul-nav); }
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; gap: 0;
}
.nav-link {
  color: var(--branco); text-decoration: none;
  font-family: var(--font-main); font-weight: 700; font-size: 14px;
  padding: 14px 28px; display: block;
  transition: background 0.15s; letter-spacing: 0.02em;
}
.nav-link:hover  { background: rgba(255,255,255,0.08); }
.nav-link.active { background: rgba(255,255,255,0.15); border-bottom: 3px solid var(--amarelo); }
.nav-red-line { height: 3px; background: var(--vermelho); }

/* ── HERO DA PÁGINA ── */
.page-hero {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-escuro) 100%);
  padding: 36px 0 32px;
  border-bottom: 4px solid var(--vermelho);
}
.page-hero-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.page-hero-title {
  font-family: var(--font-main);
  font-size: 28px; font-weight: 800;
  color: var(--branco); margin-bottom: 6px;
}
.page-hero-sub { color: rgba(255,255,255,0.75); font-size: 15px; }

/* ── BOTÃO EDITAR (hero) ── */
.btn-editar-cardapio {
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.35);
  color: white;
  font-family: var(--font-main);
  font-weight: 700; font-size: 14px;
  padding: 12px 22px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.btn-editar-cardapio:hover { background: rgba(255,255,255,0.22); border-color: white; }
.btn-editar-cardapio.ativo {
  background: var(--vermelho);
  border-color: var(--vermelho);
  box-shadow: 0 0 16px rgba(192,57,43,0.5);
}

/* ── MAIN ── */
.main       { flex: 1; padding: 36px 0; }
.main-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; gap: 28px; }

/* ── NAVEGAÇÃO DE SEMANA ── */
.semana-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: white; border-radius: var(--radius);
  padding: 16px 24px; box-shadow: var(--shadow);
}
.semana-info { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.semana-label {
  font-family: var(--font-main); font-size: 16px; font-weight: 700;
  color: var(--azul); text-align: center;
}
.btn-semana {
  background: var(--azul); color: white; border: none;
  font-family: var(--font-main); font-weight: 700; font-size: 14px;
  padding: 10px 20px; border-radius: var(--radius); cursor: pointer;
  transition: background 0.15s; white-space: nowrap;
}
.btn-semana:hover { background: var(--azul-escuro); }
.btn-hoje {
  background: transparent; border: 1.5px solid var(--azul);
  color: var(--azul); font-family: var(--font-main); font-weight: 700; font-size: 13px;
  padding: 6px 16px; border-radius: 20px; cursor: pointer; transition: all 0.15s;
}
.btn-hoje:hover { background: var(--azul); color: white; }

/* ── GRADE DOS DIAS ── */
.dias-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

/* ── CARD DE DIA ── */
.dia-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
  border-top: 4px solid var(--verde);
  transition: transform 0.15s, box-shadow 0.15s;
}
.dia-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.13); }

.card-hoje    { border-top-color: var(--azul); box-shadow: 0 0 0 3px var(--azul), var(--shadow); }
.card-alterado{ border-top-color: var(--amarelo); }
.card-sem     { border-top-color: var(--vermelho); }
.card-passado { opacity: 0.70; }

.dia-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f0f0f5;
}
.dia-nome {
  font-family: var(--font-main); font-size: 14px; font-weight: 800;
  color: var(--azul); text-transform: uppercase; letter-spacing: 0.04em;
}
.dia-data { font-size: 12px; color: #777; margin-top: 2px; }

.dia-top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.hoje-tag {
  background: var(--azul); color: white;
  font-family: var(--font-main); font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; letter-spacing: 0.03em;
}

.btn-editar-dia {
  background: var(--cinza-bg); border: 1px solid #d0d8e8;
  color: var(--azul); font-size: 14px;
  width: 32px; height: 32px; border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.btn-editar-dia:hover { background: var(--azul); color: white; border-color: var(--azul); }

/* Badge de status */
.badge {
  display: block; font-size: 12px; font-weight: 600;
  padding: 6px 16px; text-align: center;
}
.badge-amarelo { background: #fff8e1; color: #7a5800; border-bottom: 1px solid #ffe082; }
.badge-vermelho{ background: #ffebee; color: #b71c1c; border-bottom: 1px solid #ffcdd2; }

/* Corpo do card */
.dia-corpo {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 12px;
  flex: 1;
}
.corpo-apagado { opacity: 0.45; pointer-events: none; }

.refeicao { display: flex; align-items: flex-start; gap: 10px; }
.ref-icon  { font-size: 20px; flex-shrink: 0; line-height: 1.2; }
.ref-label {
  display: block; font-family: var(--font-main);
  font-size: 11px; font-weight: 700; color: var(--azul);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px;
}
.ref-texto { font-size: 13px; color: #444; line-height: 1.5; }

.refeicao-obs {
  font-size: 12px; color: #666; font-style: italic;
  background: #f8f9fb; border-left: 3px solid var(--amarelo);
  padding: 6px 10px; border-radius: 0 4px 4px 0;
}

.dia-vazio {
  font-size: 13px; color: #aaa; font-style: italic;
  text-align: center; padding: 16px 0;
}

/* ── LEGENDA ── */
.legenda {
  display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
  background: white; padding: 14px 24px; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.legenda-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #555; }
.leg-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.leg-verde   { background: var(--verde); }
.leg-amarelo { background: var(--amarelo); }
.leg-vermelho{ background: var(--vermelho); }

/* ── LOADING ── */
.loading {
  grid-column: 1 / -1; text-align: center;
  padding: 60px; color: #999; font-size: 15px;
}

/* ══════════════════════════════════
   MODAIS
══════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: white; border-radius: 12px;
  padding: 36px 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 18px;
  animation: fadeUp 0.2s ease;
}
.modal-box-lg { max-width: 520px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-icon-wrap {
  font-size: 36px; text-align: center; line-height: 1;
}
.modal-titulo {
  font-family: var(--font-main); font-size: 22px; font-weight: 800;
  color: var(--azul); text-align: center;
}
.modal-sub { font-size: 14px; color: #888; text-align: center; margin-top: -10px; }

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label {
  font-family: var(--font-main); font-size: 13px; font-weight: 700;
  color: var(--azul); text-transform: uppercase; letter-spacing: 0.04em;
}
.input-group input,
.input-group textarea {
  padding: 12px 14px;
  border: 1.5px solid #d0d8e8;
  border-radius: var(--radius);
  font-family: var(--font-body); font-size: 14px; color: var(--texto);
  transition: border-color 0.2s; resize: vertical;
}
.input-group input:focus,
.input-group textarea:focus { outline: none; border-color: var(--azul); }

/* Status buttons */
.status-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.status-btn {
  flex: 1; min-width: 100px;
  padding: 10px 8px; border: 2px solid #d0d8e8;
  background: white; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: #666; cursor: pointer; transition: all 0.15s; text-align: center;
}
.status-btn:hover { border-color: var(--azul); color: var(--azul); }
.status-btn.ativo { border-color: var(--azul); background: var(--azul); color: white; }

.modal-erro { font-size: 13px; color: var(--vermelho); text-align: center; min-height: 16px; }

.modal-actions { display: flex; gap: 10px; }
.btn-cancelar {
  flex: 1; padding: 12px;
  background: transparent; border: 1.5px solid #d0d8e8;
  color: #666; border-radius: var(--radius);
  font-family: var(--font-main); font-weight: 700; font-size: 14px;
  cursor: pointer; transition: all 0.15s;
}
.btn-cancelar:hover { border-color: #999; color: var(--texto); }
.btn-primary {
  flex: 2; padding: 12px;
  background: var(--azul); border: none;
  color: white; border-radius: var(--radius);
  font-family: var(--font-main); font-weight: 700; font-size: 14px;
  cursor: pointer; transition: background 0.15s;
}
.btn-primary:hover    { background: var(--azul-escuro); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── TOAST ── */
.toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
  pointer-events: none;
}
.toast {
  background: #1a1a2e; color: white;
  padding: 12px 24px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  animation: slideUp 0.3s ease; white-space: nowrap;
}
.toast.toast-success { background: var(--verde); }
.toast.toast-error   { background: var(--vermelho); }
.toast.hide          { animation: fadeOut 0.35s ease forwards; }

@keyframes slideUp  { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }
@keyframes fadeOut  { to   { opacity:0; transform: translateY(8px); } }

/* ── FOOTER ── */
.footer { background: var(--azul); color: white; margin-top: auto; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 36px 24px;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px;
}
.footer-heading { font-family: var(--font-main); font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.footer-line { font-size: 13px; color: rgba(255,255,255,0.82); line-height: 1.7; margin-bottom: 6px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: rgba(255,255,255,0.82); text-decoration: none; font-size: 13px; transition: color 0.15s; }
.footer-links a:hover { color: white; }
.pe-brand { display: flex; align-items: center; gap: 14px; }
.pe-logo  { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }
.pe-text  { display: flex; flex-direction: column; gap: 1px; }
.pe-gov   { font-size: 10px; letter-spacing: 0.08em; color: rgba(255,255,255,0.7); font-weight: 600; }
.pe-name  { font-family: var(--font-main); font-size: 20px; font-weight: 800; color: white; line-height: 1; }
.pe-sub   { font-size: 10px; color: rgba(255,255,255,0.7); }
.footer-bottom {
  text-align: center; font-size: 12px; color: rgba(255,255,255,0.55);
  padding: 14px 24px; border-top: 1px solid rgba(255,255,255,0.12);
}

.footer-credito-destaque {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.footer-credito-destaque a {
  color: var(--amarelo);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-credito-destaque a:hover { color: white; text-decoration: underline; }

.footer-institucional {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* ══════════════════════════════════
   RESPONSIVO
══════════════════════════════════ */
@media (max-width: 1024px) {
  .dias-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .header-logo  { width: 52px; height: 52px; }
  .header-title { font-size: 15px; }
  .nav-link     { padding: 12px 14px; font-size: 13px; }

  .page-hero-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .page-hero-title { font-size: 22px; }
  .btn-editar-cardapio { width: 100%; text-align: center; }

  .semana-nav { flex-direction: column; gap: 10px; }
  .btn-semana { width: 100%; }

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

  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
  .dias-grid { grid-template-columns: 1fr; }
  .main-inner { padding: 0 16px; }
  .modal-box  { padding: 28px 20px 24px; }
  .status-btns { flex-direction: column; }
}


/* ── CAMPO EDITÁVEL ── */
.editor-cardapio {
  min-height: 40px;
  font-size: 13px;
  color: var(--texto);
  line-height: 1.7;
  outline: none;
}

.editor-cardapio .vazio {
  color: #bbb;
  font-style: italic;
  font-size: 13px;
  pointer-events: none;
}

.editor-cardapio.editando {
  background: #fffbea;
  border: 2px dashed #e6b800;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 120px;
  cursor: text;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.50);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: white;
  border-radius: 12px;
  padding: 36px 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.20);
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.2s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-icon-wrap { font-size: 36px; text-align: center; }
.modal-titulo {
  font-family: var(--font-main);
  font-size: 22px; font-weight: 800;
  color: var(--azul); text-align: center;
}
.modal-sub {
  font-size: 14px; color: #888;
  text-align: center; margin-top: -8px;
}

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label {
  font-family: var(--font-main);
  font-size: 12px; font-weight: 700;
  color: var(--azul);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.input-group input {
  padding: 12px 14px;
  border: 1.5px solid #d0d8e8;
  border-radius: 8px;
  font-family: var(--font-body); font-size: 14px;
  transition: border-color 0.2s; color: var(--texto);
}
.input-group input:focus { outline: none; border-color: var(--azul); }

.modal-erro {
  font-size: 13px; color: var(--vermelho);
  text-align: center; min-height: 16px;
}

.modal-actions { display: flex; gap: 10px; }
.btn-cancelar {
  flex: 1; padding: 12px;
  background: transparent; border: 1.5px solid #d0d8e8;
  color: #666; border-radius: 8px;
  font-family: var(--font-main); font-weight: 700; font-size: 14px;
  cursor: pointer; transition: all 0.15s;
}
.btn-cancelar:hover { border-color: #999; color: var(--texto); }
.btn-primary {
  flex: 2; padding: 12px;
  background: var(--azul); border: none;
  color: white; border-radius: 8px;
  font-family: var(--font-main); font-weight: 700; font-size: 14px;
  cursor: pointer; transition: background 0.15s;
}
.btn-primary:hover    { background: var(--azul-escuro); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
}
.toast {
  background: var(--texto);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  white-space: nowrap;
  animation: slideUp 0.3s ease;
}
.toast.toast-success { background: var(--verde); }
.toast.toast-error   { background: var(--vermelho); }
.toast.hide          { animation: fadeOut 0.35s ease forwards; }

@keyframes slideUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeOut { to   { opacity:0; transform:translateY(6px); } }
/* Modernização visual compartilhada */
:root { --surface-border:#dbe2ee; --soft-shadow:0 10px 30px rgba(18,45,110,.10); --radius-lg:14px; }
*,*::before,*::after { box-sizing:border-box; }
body { overflow-x:hidden; line-height:1.5; }
button,input,textarea { font:inherit; }
:focus-visible { outline:3px solid rgba(240,192,48,.8); outline-offset:3px; }
.header { background:linear-gradient(110deg,#122d6e,#1a3c8f); }
.nav-inner { overflow-x:auto; scrollbar-width:none; }
.nav-link { white-space:nowrap; }
.page-hero-inner { gap:20px; }
.page-hero-title,.btn-editar-cardapio,.modal-icon-wrap,.status-btn,.btn-primary { display:flex;align-items:center;gap:8px; }
.ui-icon { width:1.15em;height:1.15em;flex:0 0 auto; }
.dias-grid { grid-template-columns:repeat(5,minmax(0,1fr)); gap:14px; }
.dia-card,.semana-nav,.modal-box { border-radius:var(--radius-lg); box-shadow:var(--soft-shadow); }
button { min-height:42px; }
input,textarea { max-width:100%; }
.toast-container { width:min(380px,calc(100vw - 32px)); right:16px;bottom:16px; }
.toast { width:100%;min-width:0;border-radius:10px;box-shadow:0 12px 30px rgba(18,45,110,.18); }
@media(max-width:900px){.dias-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dia-card:last-child{grid-column:1/-1}.page-hero-inner{align-items:center}}
@media(max-width:600px){.header-inner,.main-inner,.page-hero-inner{padding-left:16px;padding-right:16px}.header-title{font-size:13px}.header-title br{display:none}.header-logo{width:56px;height:56px}.nav-inner{padding:0 6px}.nav-link{padding:12px 14px}.page-hero-inner{flex-direction:column;align-items:stretch}.btn-editar-cardapio{justify-content:center;width:100%}.dias-grid{grid-template-columns:1fr}.dia-card:last-child{grid-column:auto}.modal-overlay{padding:12px}.modal-box{width:100%;max-height:calc(100dvh - 24px);overflow-y:auto}.modal-actions{position:sticky;bottom:0;background:inherit;padding-top:8px}.footer-inner{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
