:root {
  --vb-blue: #2f5bff;
  --vb-blue-dark: #2447d8;

  --vb-bg: #f3f6ff;
  --vb-card: #ffffff;
  --vb-text: #0f172a;
  --vb-muted: rgba(15, 23, 42, 0.62);
  --vb-border: rgba(2, 6, 23, 0.10);

  --vb-radius: 14px;
  --vb-shadow: 0 10px 26px rgba(2, 6, 23, 0.08);

  /* Sidebar / menu lateral */
  --vb-side: #eef4ff;
  --vb-side-hover: rgba(47, 91, 255, 0.10);
  --vb-side-active: rgba(47, 91, 255, 0.18);
}

html,
body {
  height: 100%;
}

body {
  background: var(--vb-bg);
  color: var(--vb-text);
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------------- APP SHELL ---------------- */

.vb-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------------- TOP BAR ---------------- */

.vb-topbar {
  height: 64px;
  background: var(--vb-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.15);
  position: sticky;
  top: 0;
  z-index: 1040;
}

.vb-topbar-left,
.vb-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vb-icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 12px;
  min-width: 38px;
  height: 38px;
}

.vb-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.vb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -.02em;
}

.vb-brand:hover {
  color: #fff;
  text-decoration: none;
}

.vb-brand-icon {
  font-size: 20px;
}

.vb-brand-text {
  font-size: 1.1rem;
}

/* Institution badge on top-right */
.vb-inst {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 6px 10px;
  border-radius: 12px;
  max-width: 280px;
}

.vb-inst img {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fff;
  object-fit: contain;
}

.vb-inst-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
}

.vb-inst-text {
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- BODY ---------------- */

.vb-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ---------------- SIDEBAR ---------------- */

.vb-sidebar {
  width: 240px;
  background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
  border-right: 1px solid rgba(47, 91, 255, 0.12);
  display: flex;
  flex-direction: column;
  transition: width .2s ease;
}

.vb-side-inner {
  padding: 12px;
  overflow: auto;
}

.vb-side-footer {
  padding: 12px;
  border-top: 1px solid var(--vb-border);
  background: rgba(255, 255, 255, 0.55);
}

/* Section toggles */
.vb-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  padding: 10px 10px;
  border-radius: 12px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.70);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem;
}

.vb-section-toggle:hover {
  background: rgba(2, 6, 23, 0.04);
}

.vb-sec-chevron {
  transition: transform .15s ease;
}

.vb-section-toggle[aria-expanded="true"] .vb-sec-chevron {
  transform: rotate(180deg);
}

/* Nav links */
.vb-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 2px 2px;
}

.vb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(15, 23, 42, 0.78);
  transition: all .15s ease;
}

.vb-link i {
  font-size: 18px;
  min-width: 20px;
  text-align: center;
  color: rgba(15, 23, 42, 0.65);
}

.vb-link:hover {
  background: var(--vb-side-hover);
  color: var(--vb-blue);
  text-decoration: none;
}

.vb-link:hover i {
  color: var(--vb-blue);
}

.vb-link.active {
  background: var(--vb-side-active);
  color: var(--vb-blue);
  font-weight: 900;
}

.vb-link.active i {
  color: var(--vb-blue);
}

.vb-link-text {
  white-space: nowrap;
}

/* User footer */
.vb-user-name {
  font-weight: 900;
}

.vb-user-meta {
  font-size: .85rem;
  color: rgba(15, 23, 42, 0.55);
}

.vb-logout {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.18);
  background: rgba(239, 68, 68, 0.06);
}

.vb-logout:hover {
  background: rgba(239, 68, 68, 0.10);
  color: #ef4444;
  text-decoration: none;
}

/* Sidebar collapsed */
.vb-sidebar.is-collapsed {
  width: 84px;
}

.vb-sidebar.is-collapsed .vb-link-text,
.vb-sidebar.is-collapsed .vb-sec-title,
.vb-sidebar.is-collapsed .vb-user-meta,
.vb-sidebar.is-collapsed .vb-sec-chevron {
  display: none !important;
}

.vb-sidebar.is-collapsed .vb-link {
  justify-content: center;
}

.vb-sidebar.is-collapsed .vb-logout {
  justify-content: center;
}

.vb-sidebar.is-collapsed .vb-logout .vb-link-text {
  display: none !important;
}

/* ---------------- CONTENT ---------------- */

.vb-content {
  flex: 1;
  min-width: 0;
  overflow: auto;
}

.vb-container {
  max-width: 1200px;
  padding: 16px;
}

.vb-pagehead {
  margin-bottom: 12px;
}

.vb-title {
  font-size: 1.35rem;
  font-weight: 950;
  letter-spacing: -.02em;
}

.vb-subtitle {
  color: var(--vb-muted);
  font-size: .92rem;
}

/* ---------------- BREADCRUMB ---------------- */

.breadcrumb {
  font-size: .9rem;
}

.breadcrumb-item a {
  text-decoration: none;
}

/* ---------------- GLOBAL CARDS / FORMS ---------------- */

.card {
  border: 0;
  border-radius: var(--vb-radius);
  box-shadow: var(--vb-shadow);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--vb-border);
  font-weight: 900;
}

.section-card {
  background: var(--vb-card);
  border-radius: var(--vb-radius);
  box-shadow: var(--vb-shadow);
  padding: 14px 16px;
}

.kpi {
  background: var(--vb-card);
  border-radius: var(--vb-radius);
  box-shadow: var(--vb-shadow);
  padding: 14px 16px;
}

.kpi .label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--vb-muted);
  font-weight: 800;
}

.kpi .value {
  font-size: 1.45rem;
  font-weight: 950;
}

/* Buttons */
.btn {
  border-radius: 12px;
}

/* Inputs */
.form-control,
.form-select,
textarea {
  border-radius: 12px;
  border-color: var(--vb-border);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: rgba(47, 91, 255, 0.45);
  box-shadow: 0 0 0 .25rem rgba(47, 91, 255, 0.12);
}

/* Tables */
.table thead th {
  font-size: .78rem;
  color: rgba(15, 23, 42, 0.55);
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 1px solid var(--vb-border);
}

.table tbody td {
  border-top: 1px solid rgba(2, 6, 23, 0.06);
}

/* Badges */
.badge {
  border-radius: 999px;
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .82rem;
  border: 1px solid rgba(2, 6, 23, 0.10);
  background: #fff;
}

.chip.primary {
  background: rgba(47, 91, 255, 0.10);
  border-color: rgba(47, 91, 255, 0.20);
  color: var(--vb-blue-dark);
}

.chip.info {
  background: rgba(14, 165, 233, 0.10);
  border-color: rgba(14, 165, 233, 0.20);
  color: #0369a1;
}

/* ---------------- MOBILE / OFFCANVAS ---------------- */

.vb-mobile-inst {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--vb-border);
  border-radius: 12px;
  background: #fff;
}

.vb-mobile-inst img {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fff;
  object-fit: contain;
}

@media (max-width: 991.98px) {
  .vb-container {
    padding: 14px;
  }
}

/* ---------------- MOBILE CTA BOTTOM BAR ---------------- */

.mobile-cta {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1050;
}

/* Só cria espaço extra quando a CTA existe */
@media (max-width: 991.98px) {
  body.has-mobile-cta .vb-container {
    padding-bottom: 90px;
  }
}

/* ==========================================================================
   MELHORIAS DE USABILIDADE & RESPONSIVIDADE (UI/UX - FRIENDLY)
   ========================================================================== */

/* 1. Otimização de Toque para Equipamentos Móveis */
@media (max-width: 991.98px) {
  /* Botões maiores e fáceis de carregar com o polegar */
  .btn, .form-control, .form-select {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Evita atrasos ou cliques duplos acidentais no mobile */
  a, button {
    touch-action: manipulation;
  }
}

/* 2. Cartões de Ementa e Marcação Modernizados */
.daycard {
  border: 1px solid var(--vb-border) !important;
  border-left: 5px solid var(--vb-blue) !important;
  border-radius: var(--vb-radius) !important;
  background: var(--vb-card);
  box-shadow: 0 4px 18px rgba(2, 6, 23, 0.03);
  transition: transform .2s ease, box-shadow .2s ease;
  overflow: hidden;
}

.daycard:hover {
  transform: translateY(-2px);
  box-shadow: var(--vb-shadow);
}

.card-header-day {
  background: rgba(47, 91, 255, 0.02) !important;
  border-bottom: 1px solid var(--vb-border) !important;
  padding: 12px 16px !important;
}

.daytitle {
  font-weight: 950;
  color: var(--vb-blue-dark);
}

/* 3. Linhas de Itens com Ícones (Alternativa a textos repetitivos) */
.menu-item-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--vb-border);
}
.menu-item-row:last-child {
  border-bottom: 0;
}

.menu-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}
.icon-soup { background: rgba(47, 91, 255, 0.1); color: var(--vb-blue-dark); }
.icon-main { background: rgba(34, 197, 94, 0.1); color: #166534; }
.icon-dessert { background: rgba(245, 158, 11, 0.1); color: #92400e; }

/* 4. Barra Móvel Flutuante de Alta Qualidade (Efeito Desfoque / iOS) */
@media (max-width: 991.98px) {
  .mobile-cta {
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    padding: 14px 16px 20px 16px;
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(2, 6, 23, 0.08);
    box-shadow: 0 -8px 24px rgba(2, 6, 23, 0.06) !important;
    z-index: 1050;
  }

  /* Padding extra de segurança diretamente no body controlado pelo JS */
  body.has-mobile-cta {
    padding-bottom: 84px !important;
  }
  body.has-mobile-cta .vb-container {
    padding-bottom: 20px !important;
  }
}