/* ===========================
   METAS - FIX UI (scoped)
   =========================== */

/* Header layout (para perfil derecha) */
.titulo-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
}

.titulo-left{
  min-width: 0;
}

.titulo-right{
  position: relative;
  display:flex;
  align-items:center;
  gap: 10px;
  justify-content:flex-end;
}

/* Bloque perfil */
.user-profile{
  display:flex;
  align-items:center;
  gap: 8px;
  cursor:pointer;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
}

.user-avatar{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
}

.user-name{
  font-weight: 800;
  font-size: 13px;
  opacity: .95;
}

/* Dropdown menu */
.user-menu{
  position:absolute;
  top: 44px;
  right: 0;
  min-width: 180px;
  border-radius: 14px;
  background: rgba(18,18,22,.96);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  overflow:hidden;
  display:none;
  z-index: 12050;
}

.user-menu.visible{ display:block; }

.user-menu a{
  display:block;
  padding: 10px 12px;
  text-decoration:none;
  color: inherit;
  font-weight: 700;
  opacity: .95;
}

.user-menu a:hover{
  background: rgba(255,255,255,.06);
}

/* util */
.hidden{ display:none !important; }

/* Toolbar fuera del header */
.metas-toolbar{
  display:flex;
  justify-content:flex-end;
  margin-top: 12px;
  margin-bottom: 10px;
}

/* Botones (solo esta vista, por si master no aplica) */
.btn-primary,
.btn-secondary,
.btn-danger{
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  cursor: pointer;
  border: 1px solid transparent;
  background: rgba(255,255,255,.06);
  color: inherit;
}

.btn-primary{
  background: rgba(120, 90, 255, .25);
  border-color: rgba(120, 90, 255, .45);
}
.btn-primary:hover{ background: rgba(120, 90, 255, .32); }

.btn-secondary{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
.btn-secondary:hover{ background: rgba(255,255,255,.10); }

.btn-danger{
  background: rgba(255, 70, 90, .18);
  border-color: rgba(255, 70, 90, .45);
  color: rgba(255, 220, 230, 1);
}
.btn-danger:hover{ background: rgba(255, 70, 90, .28); }

/* =========================
   Tabs UI
========================= */
.tabs-wrapper {
  margin: 10px 20px 20px;
  display: flex;
  justify-content: center;
}

.tabs-container {
  display: flex;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}

/* ===========================
   Grid centrada
   =========================== */
.metas-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 14px;
  padding: 12px 0 30px;

  /* ✅ centra el bloque dentro del contenedor */
  max-width: 980px;
  margin: 0 auto;
}

/* Card */
.meta-card{
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 14px;

  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
}

.meta-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}

.meta-title{
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.meta-date{
  margin-top: 4px;
  font-size: 12px;
  opacity: .75;
}

.meta-nums{
  margin-top: 10px;
  display:flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 13px;
}

.meta-nums span{
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
}

.progress-wrap{ margin-top: 12px; }
.progress-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size: 12px;
  opacity: .85;
  margin-bottom: 6px;
}
.progress-bar{
  height: 10px;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.08);
}
.progress-fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 900ms cubic-bezier(.2,.9,.2,1);
}
.fill-green{ background: linear-gradient(90deg, rgba(80,220,140,.95), rgba(120,240,170,.85)); }
.fill-yellow{ background: linear-gradient(90deg, rgba(245,200,70,.95), rgba(255,230,130,.85)); }
.fill-orange{ background: linear-gradient(90deg, rgba(255,150,70,.95), rgba(255,190,120,.85)); }
.fill-red{ background: linear-gradient(90deg, rgba(255,90,110,.95), rgba(255,140,160,.80)); }

.meta-smart{
  margin-top: 12px;
  padding: 10px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  line-height: 1.35;
}
.meta-smart .line{ margin-top: 6px; opacity: .92; }
.meta-smart strong{ font-weight: 900; }

.meta-actions{
  display:flex;
  gap: 8px;
  margin-top: 12px;
}
.meta-actions button{
  flex: 1;
  min-height: 38px;
}

/* Empty state centrado */
.empty-state{
  padding: 22px 0 40px;
  max-width: 980px;
  margin: 0 auto;
}
.empty-card{
  max-width: 560px;
  margin: 0 auto;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
  text-align: center;
}

/* ===========================
   Modal centrado + estilos
   =========================== */
.modal:not(.modal-movimiento){ display:none; }
.modal.open{
  display:flex;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items:center;
  justify-content:center;
  padding: 16px;
  z-index: 9999;
}

.modal .modal-content{
  width: 100%;
  max-width: 520px;
  border-radius: 18px;
  background: rgba(18,18,22,.96);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  overflow:hidden;
}

.modal .modal-header{
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.modal .modal-body{ padding: 14px; }

.modal .modal-footer{
  padding: 12px 14px;
  display:flex;
  gap: 10px;
  justify-content:flex-end;
  border-top: 1px solid rgba(255,255,255,.08);
}

.modal .modal-close{
  border:0;
  background: transparent;
  cursor:pointer;
  padding: 6px 10px;
  border-radius: 10px;
  color: rgba(255,255,255,.85);
}
.modal .modal-close:hover{ background: rgba(255,255,255,.06); }

/* Inputs */
.field{ display:block; margin-bottom: 12px; }
.field span{ display:block; font-size: 12px; opacity: .85; margin-bottom: 6px; }

.field input{
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.92);
  outline: none;
}

.field input:focus{
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.07);
}

.hint{
  margin: 0 0 10px;
  opacity: .85;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 560px){
  .titulo-row{ align-items:flex-start; }
  .user-name{ display:none; }
}
@media (max-width: 420px){
  .metas-grid{ grid-template-columns: 1fr; }
  .meta-actions{ flex-direction: column; }
  .metas-toolbar{ justify-content:stretch; }
  .metas-toolbar .btn-primary{ width: 100%; }
}